I’ve installed onlyoffice on a separate server in a docker container. Onlyoffice is working fine, and is able to connect to my nextcloud webdav. However, when trying to connect the document service via the connector app in Nextcloud, I just get “Error when trying to connect (Bad Request or timeout error)” when saving, and the integration doesn’t work. Any idea where I should start looking to try to diagnose/fix?
You could try to reach Onlyoffice from your NC server via curl for example and check that you use the correct port and that firewalls aren’t blocking anything.
Check the log files of course. Maybe they give some further hints, what exactly fails.
You could open the browser debug console and look for suspicious error messages. I’m not sure if your Content Security Policy (CSP) settings could interfere here.
I’m able to curl and everything looks fine. I can also access the entire onlyoffice installation via a browser. Nextcloud log is telling me this:
{“reqId”:“XAxkmn3FplvPn5X8XHWSIQAAABQ”,“level”:3,“time”:“2018-12-09T00:40:59+00:00”,“remoteAddr”:“98.198.135.215”,“user”:“koree”,“app”:“PHP”,“method”:“PUT”,“url”:"/index.php/apps/onlyoffice/ajax/settings",“message”:“file_get_contents(http://onlyoffice.koree.me/healthcheck): failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway\r\n at /home/koreeme/public_html/nextcloud/apps/onlyoffice/lib/documentservice.php#385”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15”,“version”:“14.0.4.2”}
Well not an expert, but how I understand it, when I came accross that sometimes: In the nginx config file you can configure different/ multiple server and upstream. And in the server parts you usually link to the upstream; for example to link to the php-handler (fpm).
When this error message occurs now, it means that the defined upstream is unknown or not configured correctly. While Onlyoffice runs in a docker container that’s rather difficult to check and fix though.
I just send this info out, although I have no solution right now, but I try to think of something. Maybe it helps you already and you figure something yourself out in the meantime.
What’s interesting is, the onlyoffice portal itself works just fine and great. Just can’t connect to the document service from outside. That’s probably a clue of some sort…
I was wondering later when my PC was already shutdown: you use the Onlyoffice Community-Server docker image, right? That’s my guess due to the login screen, which I don’t have for my Onlyoffice docker image and I am using the Document-Server. I’m not sure if the Community-Server is supposed to have that healthcheck and run with Nextcloud.
Anyway, can you get to the nginx config (where the server and upstreams are configured) and post them here? Maybe we find something useful in there.
I ended up abandoning the docker version of this and just installed natively. Everything worked perfectly the first time. My final verdict is that I hate Docker.
I have this problem as well now, since 2 weeks already and I can’t fix it myself. It started with the update to NC15 and I tried to fix it with an update of the docker version of Onlyoffice as well, but no luck so far
I’m really frustrated right now.
@koree Could you explain how exactly you installed Onlyoffice natively? On the very same machine Nextcloud runs on? Which web servers are NC and Onlyoffice using on your system? Could you probably share how you achieved that and your config files so I could follow your way?