Collabora Document Blank

I have recently set up Collabora on a Nextcloud server. Nextcloud was set up using a snap, running on port 444, on a Linux server. The distribution is Ubuntu 18.04.4. Collabora was set up using an apache proxy server, which is running on port 8444. This is reflected in the browser error logs below.

I followed this tutorial to get started, although I had to make minor adjustments for my domain setup, and my Nextcloud snap setup:

I was able to successfully get Collabora running, but it does not load up documents. Rather, it only loads a header and footer, as seen in the screenshot below:

Looking at my browser logs, there appears to be a socket connection error (Using placeholder domains for these logs, but I have kept the port numbers):

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). contentscript.js:1:380015
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). contentscript.js:1:380015
SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
2 loleaflet.html:21:20
SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
2 loleaflet.html:21:20
Firefox can’t establish a connection to the server at wss://COLLABORA-DOMAIN:8444/lool/https%3A%2F%2FNEXTCLOUD-DOMAIN%3A444%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F8_oc7wad87wuk7%3Faccess_token%3DGKM8ihrQhtImd3savzNBE5IHNMRSN6ZZ%26access_token_ttl%3D0/ws?WOPISrc=https%3A%2F%2FNEXTCLOUD-DOMAIN%3A444%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F8_oc7wad87wuk7&compat=/ws. loleaflet.html:202:3163
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
Firefox can’t establish a connection to the server at wss://COLLABORA-DOMAIN:8444/lool/https%3A%2F%2FNEXTCLOUD-DOMAIN%3A444%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F8_oc7wad87wuk7%3Faccess_token%3DGKM8ihrQhtImd3savzNBE5IHNMRSN6ZZ%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2FNEXTCLOUD-DOMAIN%3A444%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F8_oc7wad87wuk7&compat=/ws. 2 bundle.js:40:32012
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
Firefox can’t establish a connection to the server at wss://COLLABORA-DOMAIN:8444/lool/https%3A%2F%2FNEXTCLOUD-DOMAIN%3A444%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F8_oc7wad87wuk7%3Faccess_token%3DGKM8ihrQhtImd3savzNBE5IHNMRSN6ZZ%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2FNEXTCLOUD-DOMAIN%3A444%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F8_oc7wad87wuk7&compat=/ws. bundle.js:40:32012
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 2 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52
bundle.js:54:26871
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    _postMessageListener https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:54
    handler https://COLLABORA-DOMAIN:8444/loleaflet/b889fbb/bundle.js:52

SSL has been successfully implemented for both my collabora domain and my nextcloud domain, and I have verified that these are pointing to the right IP. So why is there an issue with the socket connection?

I ran the following curl command for my nextcloud domain(port :444), my collabora domain(port :8444), and 127.0.0.1 (localhost, port :9980) on my server. The command returned without error for the nextcloud and collabora domains, but threw a self-signed certificate error for localhost:

curl -I https://127.0.0.1:9980/hosting/capabilities/
curl: (60) SSL certificate problem: self signed certificate in certificate chain
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it.

I don’t have an in-depth understanding of this stuff, but I know that the docker container I’m running collabora in is using 127.0.0.1:9980. Is the certificate issue causing the socket to fail to connect, or am I barking up the wrong tree? How might I go about resolving my issue?

If anyone needs more information, I will happily provide it.

We are having a similar issue with blank documents. Not using docker but have nextcloud and collabora on separate servers. We originally used apache but switched to nginx and even tried disabling SSL and still no success. Not sure where the problem is, still troubleshooting. Were you able to get this issue resolved?

1 Like

Same Issue here. I tried LibreOffice, too; same issue. Was thinking about nginx conf might be wrong?

Very grateful for any solutions or hints to such

Setup:
Docker:
Nextcloud 19
Collabora / LibreOffice without SSL
nginx reverse proxy for both with SSL

Same issue here, both in Docker containers.
Did any of you find a resolution?

Seems to be a very common issue! I have been working on this for hours and have managed to eliminate all the server errors that I thought were causing it but I still get blank documents! It’s starting to do my head in :wink:

My config is Nextcloud & Collabora running on separate containers with an NGINX Proxy fronting everything with Lets Encrypt SSL. All running on the same Docker host.

It may not be the same issue for you, but solved it by changing the collabora docker ‘domain’ variable from:
cloud\\.domain\\.com
to
cloud\.domain\.com
Newer versions of Collabora changed how they escape the periods… :confused:

1 Like

@Ruthalas I managed to get mine working in the end also. I found the domain was more of an issue at the start when I was doing the discovery - That was a bit more of a RTFM concern :laughing:

Another worth noting is the allowed ip addresses in the loolwsd.xml for containers that talk over public IP.

The final issue I found was that Collabora was serving up http to the browser when called by Nextcloud (Both containers are proxied via Nginx with https termination and ssl enforced). There is another setting in loolwsd.xml to deal with that, by changing ssl.termination = true (also make sure ssl.enabled = false) - This ensures that all URLs that are forwarded to the browser specify https.

I’m a happy little nextcloud camper again now! :wink: