When I try to create a diagram page, I get a spinner icon that goes on endlessly. I’ve tried using Windows/Firefox, MacOS/safari and the result is the same.
Does anyone have any suggestions as to how I could debug this problem so I can get the diagram application extension to work?
server: xwiki 10.1, tomcat8, ubuntu 16.04
client: mac osx 10.12 & safari, windows 10 & firefox latest version.
The wiki is accessed via an nginx proxy and everything else seems to work correctly.
I don’t see any relevant errors in the tomcat catalina.out logs.
Any insight or advice would be greatly appreciated.
You should check the JavaScript console from the browsers’s developer tools. See if there are JavaScript exceptions logged. You can also check the Network tab (from the same developer tools) to see if there are failed requests (e.g. 404) for the Diagram Application resources (JavaScript, CSS).
You should also clear the browser cache to make sure you don’t have outdated Diagram Application resources cached in the browser.
Just tested the application on xwiki 10.1 Debian without reverse proxy and launching the app works. Clients were FF and Chrome latest on Win 10.
Did you already have a look in the browsers web development tools (reachable via F12 key on windows)?
I’d either expect that some of the resources can’t be loaded (see network tab) or that a script fails (see console tab). Investigate in this order, because a script that fails to load may cause scripting errors.
Did you have a look in the nginx logs if there are any errors or requests that it fails to serve?
Can you also try to bypass nginx and see if it works then?
This results in an error because the text/x-matlab is actually not considered an executable type and the nosniff option tells the browsers to enforce strict mime checking.
So, the workaround is to weaken the security of the nginx installation.
The real question is, why is the mxgraph-editor/3.7.2/mxGraphEditor.min.js file being served from tomcat with the wrong file type?
returns text/x-matlab for mxGraphEditor.js but I don’t know why. The detection takes into account both the file name and the file content. In this case it seems there is something in the content of mxGraphEditor.js that makes Tika think the file is a `text/x-matlab``.
Loading failed for the <script> with source “http://localhost:8080/xwiki/webjars/wiki%3Axwiki/mxgraph-client/mxClient.min.js”.
Test%20Diagram:1
Error: Script error for "mxgraph-client"
http://requirejs.org/docs/errors.html#scripterror
require.min.js:7:290
Loading failed for the <script> with source “http://localhost:8080/xwiki/webjars/wiki%3Axwiki/mxgraph-editor/sanitizer/sanitizer.min.js”.
Test%20Diagram:1
Error: Script error for "sanitizer"
http://requirejs.org/docs/errors.html#scripterror
require.min.js:7:290
Error: Load timeout for modules: draw.io.viewer,mxgraph-viewer
http://requirejs.org/docs/errors.html#timeout
I no longer have this problem in the xwiki 12.8/tomcat 9/open jdk 1.8.0 under ubuntu 18.04 behind an apache 2.4.29 reverse proxy using the ajp connector