Nextcloud / OnlyOffice Refused To Connect

problem: (All Dockerized behind Traefik) When adding a new OnlyOffice document within the Nextcloud instance, the page goes straight into a blank page with a document icon with a stop sign on it. The message states ‘domain.tld’ refused to connect

Document Server version: 7.4.1
Connector version: 8.2.2
DMS (platform) version: ???
OS: Docker / Linux
Browser version: Edge / Chrome / Firefox

Hello @jdevstart

Did you connect your instance of Document Server to Nextcloud via connector app page? Please make screenshot of the settings when pressing the Save button, you will see a pop-up message in top right corner. Also, make screenshot of the page when opening a document for editing via Nextcloud.

In the meantime, please check editing in integrated test example to make sure that Document Server works properly. To do it, navigate to the Document Server address in browser, on Welcome Page you will find instruction on how to enable integrated test example. Once it is enabled, press GO TO TEST EXAMPLE button and try creating/uploading a document to edit it from there. Let me know the result.

Additionally, please specify version of Nextcloud itself.


In general, please refer to the recommended proxy settings for Document Server and compare them with your configuration:
https://helpcenter.onlyoffice.com/installation/docs-community-proxy.aspx

Sorry in advanced for the SPAM, can only attach one screenshot per post.

Yes I did, I used the connector app page.

And my Nextcloud version is 27.1.1

Just a heads up, I’ve been looking online and what I have found that closely matches my issue seems to be SSL related.

I’m hosting both Nextcloud and Onlyoffice on the same host via Docker containers. Both services can reach and ping each other but if the full chain isn’t provided in the cert, that can cause problems.

At the 12 minute mark.
Upgrade Nextcloud with ONLYOFFICE - YouTube

Unless you have more suggestions, this is the path I’m currently taking. Again, thank you for your time in assisting with this.

I think we need to take look at logs of Document Server. Please archive all logs from /var/log/onlyoffice/documentserver/ (inside Docker container) to share.


Additionally, check browser console when opening a document for editing. Best practice is:

  1. Open a document and wait until page is loaded;
  2. Open browser console (F12 in most browsers);
  3. Reload page with opened browser console.

Once page is loaded again, check Console and Network tabs for any error entries. If there are any, please make screenshots of them.

Hi,

I’m having the same problem and did find an error

Hello @gacpac
Please provide us with details:

  • Nextcloud, Document Server, the connector app versions
  • Go to the connector app and click Save button > make a screenshot of the result
  • try to open any file for editing and make a screenshot of the result
  • once the situation is reproduced, please collect Document server logs. We need to take a look at them
  • do you have any proxy-server in front of Document server?

I was also having this issue. I seemed to have fixed it by mapping a conf file to the document server container containing the following line"

add_header Content-Security-Policy “frame-ancestors self your.nexcloudurl.com;”;

The file name need to start with “ds-”, for example “ds-fixme.conf” should work. I mapped this file to /etc/nginx/includes/ds-fixme.conf as read only in my document server container.

Hello @dizzybro
Thank you for your sharing, I hope it will help in similar cases. Do I understand it right that the reason was related to incorrect config file?

I have a proxy server in front being swag docker. my version in nextcloud for onlyoffice is version 8.1.3.4
screenshot from opening a document
image
As for logs the only one i can see is from logs>documentserver>docservice> out.log

[2024-09-16T07:21:30.603] [WARN] [localhost] [docId] [userId] nodeJS - start shutdown:true
[2024-09-16T07:21:30.604] [WARN] [localhost] [docId] [userId] nodeJS - active connections: 0
[2024-09-16T07:21:30.605] [WARN] [localhost] [docId] [userId] nodeJS - end shutdown
[2024-09-16T07:23:51.229] [WARN] [localhost] [docId] [userId] nodeJS - Express server starting…
[2024-09-16T07:23:51.241] [WARN] [localhost] [docId] [userId] nodeJS - Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. File system | Node.js v22.8.0 Documentation
[2024-09-16T07:23:51.689] [WARN] [localhost] [docId] [userId] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 8.1.1. Build: 26
[2024-09-16T07:25:22.169] [WARN] [localhost] [docId] [userId] nodeJS - Express server starting…
[2024-09-16T07:25:22.183] [WARN] [localhost] [docId] [userId] nodeJS - Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. File system | Node.js v22.8.0 Documentation
[2024-09-16T07:25:22.578] [WARN] [localhost] [docId] [userId] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 8.1.1. Build: 26

here’s another log i found nginx.error.log but it’s old from a month ago so it might not be relevant.

2024/08/01 13:18:52 [error] 8660#8660: *276 open() “/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map” failed (2: No such file or directory), client: 172.18.0.4, server: , request: “GET /8.1.1-26/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1”, host: “documentserver.mydomain.com
2024/08/02 01:43:55 [error] 8660#8660: *311 open() “/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map” failed (2: No such file or directory), client: 172.18.0.4, server: , request: “GET /8.1.1-26/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1”, host: “documentserver.mydomain.com

I know the problem has to do with iframes, and my Nextcloud instance embeds the onlyoffice session in an iframe. There may be something in a Nextcloud config file somewhere to prevent this, but I’m far from being an expert in this field. It seems like in older versions of the community document server this wasn’t an issue, but what I can’t remember is if Nextcloud always used an iframe or not.

One followup to my workaround is that I noticed when using Nextcloud via a local IP address I still got the same error until I added the local ip of my Nextcloud server to the add_header line. So now it looks like this:

add_header Content-Security-Policy “frame-ancestors self your.nexcloudurl.com 192.168.x.x;”;

Now it works when accessing using my domain name from outside my network, and when accessing nextcloud using a local IP.

I also found that using a Chrome extension called Ignore X-Frame headers allowed Onlyoffice to work in Nextcloud. That’s how I narrowed it down to an iframe issue; but now everything is working with that extension removed.

what about your nextcloud setting did it give you warnings?

I’m getting Some headers are not set correctly on your instance - The X-Content-Type-Options HTTP header is not set to nosniff. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly. - The X-Frame-Options HTTP header is not set to sameorigin. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly. - The X-XSS-Protection HTTP header does not contain 1; mode=block. This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly. - The Referrer-Policy HTTP header is not set to no-referrer, no-referrer-when-downgrade, strict-origin, strict-origin-when-cross-origin or same-origin. This can leak referer information. See the W3C Recommendation. - The Strict-Transport-Security HTTP header is not set (should be at least 15552000 seconds). For enhanced security, it is recommended to enable HSTS.

FYI i’m using a reverse proxy so i’m editing at proxy settings

EDIT: I updated only in the onlyoffice nginx config for the reverse proxy and that did the trick exactly like you suggested
Thanks!

1 Like

I wasn’t seeing any errors from Nextcloud that led me to the root cause of my issue. Nextcloud was embedding Onlyoffice into an iframe, and nginx in the docserver container was not allowing this. Not sure Nextcloud was aware that something was wrong (although I could have missed something). When I used firefox, it actually gave me a more specific error.

image

This led me to assume the Nextcloud config wasn’t my issue (not saying that this can’t be fixed in Nextcloud), but the webserver in the docserver container was. I went down a rabbit hole of nginx configs on various forums to allow embedding and came across that line that posted above that finally worked.

I am a mechanical engineer, so my understanding of how all this stuff works is very minimal and it is just a hobby/learning experience for me and I’m just stumbling through it; just figured I’d share my experience that got me up and running.

Glad to hear that worked. Just make sure the config files aren’t changed in the docker container as they will be reset when the container restarts. I tried that initially and it didn’t survive a reboot (and it shouldn’t), but binding it as read only to a local file on the server works as it should

1 Like

Hi, I am having problems with one of my Nextcloud servers unable to connect with my OnlyOffice document server using the Nextcloud Connector 9.4.0. While couple of my other Nextcloud servers are able to connect to my common document server, this one throws an error when I click on the SAVE button and does not showing common settings section and the rest of the settings.

Can anyone help please?

I also tried what was suggested in the following link as well: