Multiple problems with CK editor and unusual image upload problem

Hey all, I was trying to upload some custom icons up to my Xwiki (favicon) despite it saying it failed, the files are actually uploaded and visible when you reload the page, as shown on these two images here: Microsoft OneDrive (There is no log in catalina.out saying anything is wrong, but there would not be as the upload succeeds, so not really sure if this is some strange js problem)

But thats not as big of a problem as this one when you try to add a picture to a page via the ‘edit page’ function, the moment the [picture] icon is clicked the screen flashes (like its about to draw a model) and then returns to to the editor overlay with an error in the js console: Microsoft OneDrive

Also the editor(entire of it) appears to not work in edge at all: Microsoft OneDrive just sits in loading screen forever

This may be related to: Xwiki not using HTTPS post-form submit - #2 by PaulGWebster if somewhere its generating HTTP links instead of HTTPS ? maybe

If you need any more information to help me debug this one you could also msg me on xwiki my nickname is ‘daemon’

Some additional details:
Server: FreeBSD 11.2
Java: openjdk8-8.172.11_1
XWiki(webapps/wiki/WEB-INF) # cat version.properties => version=10.6.1
DB: postgresql10-server-10.4_1
Proxy: nginx-1.14.0_10

Nginx is configured in possibly the most simple way possible, its pretty much just a straight reverse proxy, but here it is just for completeness:

http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format  main  '$host: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';

    sendfile        on;
    keepalive_timeout  65;

    gzip  on;
    server {
        listen       80;

        access_log  /var/log/nginx/http.access.log  main;

        location ^~ /.well-known {
            root   /exports/$host;
            autoindex off;
        }
        location / {
            return 301 https://$host$request_uri;
        }
    }
    server {
        listen 80;
        server_name trueos.bsddoc.com openbsd.bsddoc.com netbsd.bsddoc.com pfsence.bsddoc.com freenas.bsddoc.com;
        location / { return 302 https://bsddoc.com; }
    }
    server {
        listen       443 ssl;
        server_name  freebsd.bsddoc.com bsddoc.com;

        access_log  /var/log/nginx/xwiki.access.log  main;

        ssl_certificate /exports/le/fullchain.pem;
        ssl_certificate_key /exports/le/privkey.pem;

        location /wiki/ {
            proxy_pass                          http://bsddoc.com:8080;
            proxy_set_header    Host            $host;
            proxy_set_header    X-Forwarded-For $remote_addr;
        }
        location / {
           rewrite ^/$ https://$host/wiki/bin/view/Main/;
        }
    }
}

It looks like some of the required JavaScript resources failed to be loaded because net::err_aborted. You should fix this before going any further, i.e. you should investigate why those requests are failing. I suspect the Nginx configuration. You can probably check if these requests are served by XWiki or not (i.e. if they pass through Nginx).

When I tail the nginx log and click a button in CK editor I see:

freebsd.bsddoc.com: 185.216.51.61 - - [27/Aug/2018:16:20:33 +0000] "GET /wiki/webjars/wiki%3Afreebsd/application-ckeditor-webjar/1.23/plugins/table/dialogs/table.js?t=I62B HTTP/1.1" 404 8013 "https://freebsd.bsddoc.com/wiki/bin/edit/Main/WebHome?language=en" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.183 Safari/537.36 Vivaldi/1.96.1147.47" "-"

Which is a 404 … but that path does not seem to exist anyhow…

[17:23:17]  who is 'mflorea' or not on irc?
[17:24:02]  I seem to have a ton of 404's
[17:24:03]  https://youtu.be/w0WuoKVWAgI https://youtu.be/tHIWdoNXGec
[17:24:04]  err
[17:24:11]  [27/Aug/2018:16:20:16 +0000] "GET /wiki/webjars/wiki%3Afreebsd/application-ckeditor-webjar/1.23/plugins/image2/dialogs/image2.js?t=I62B HTTP/1.1" 404
[17:24:13]  to this address
[17:24:24]  [27/Aug/2018:16:20:24 +0000] "GET /wiki/webjars/wiki%3Afreebsd/codemirror/5.24.2/addon/search/matchesonscrollbar.css HTTP/1.1" 404 
[17:24:31]  anything to do with that address oddly
[17:25:02]  however
[17:25:03]  root@bsddoc:/usr/local/apache-tomcat-9.0/webapps # find . -name "matchesonscrollbar.css"
[17:25:03]  root@bsddoc:/usr/local/apache-tomcat-9.0/webapps #
[17:25:08]  that does not even exist

was easier to just paste what I said on IRC :stuck_out_tongue: why is it trying to fetch files that do not exist anywhere?

These files are not served directly from the file system. The path you see in the URL is not a real path on the file system. These URLs go through the “webjars” servlet which extracts them from JARs located in the class path. I’m pretty sure the issue is not that the files are missing. I suspect the problem is either that Nginx doesn’t pass the request to Tomcat or that is forwards the request to Tomcat using the wrong URL. Can you try to access XWiki directly through Tomcat without passing through Nginx?

1 Like

Very kindly fixed by @mflorea on IRC, moved my permenant-store and copied from the wrong directory -duh- all working good :slight_smile: