Proxy error with collabora

I am trying to get collabora running with Docker, following the instructions here:

Everything seems to have gone well, there were no errors during setup but I am unable to open any documents when I click them in the Nextcloud interface. The error that is thrown is this one:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /loleaflet/0adc773/loleaflet.html

Reason: Error reading from remote server.

I have tried some troubleshooting steps, to see if Docker is running, etc. but that doesn’t appear to be the problem.

docker ps
4c3d595d09ff collabora/code “/bin/sh -c 'bash st…” 14 minutes ago Up 14 minutes>9980/tcp pensive_panini

The only log line that is relevant seems to be this one, in /var/log/apache/other_vhosts_access.log which says: 89.39.x.x - - [21/Aug/2018:09:31:57 +0200] “POST /loleaflet/0adc773/loleaflet.html? HTTP/1.1” 502 4150 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0”

502 is a gateway error but I can’t seem to figure out why it seems to be throwing that.

I am running both Nextcloud and Collabora/CODE on the same machine, which is an Ubuntu 16.04 LTS based VPS, with latest Apache, etc. Certificates for and are both valid Let’s Encrypt certificates. DNS is working too.
I have tried restarting Docker but this doesn’t seem to do the trick.

Any troubleshooting suggestions are welcome. I can provide additional information when asked.

It works now! The trouble is, I am not sure what happened that made it work eventually. There’s been a couple of things that changed since my initial post.

  • There was an update to the docker-ce package for Ubuntu 16.04, which I installed.

  • I moved the Nextcloud installation from a sub-directory under the main domain to a subdomain of its own. ( >>> I followed the instructions as listed here:

  • I completely removed all traces of all collabora/code images on my server:
    $ sudo docker stop [imagenr] && sudo docker rm [[imagenr]] (you can find the image number using the command $ sudo docker ps)
    $ sudo docker container prune
    $ sudo docker rmi collabora/code

  • I then downloaded the latest collabora/code image again:
    $ sudo docker pull collabora/code
    When finished, I started the image:
    $ sudo docker run -t -d -p -e ‘domain=cloud\\.example\\.com’ -e ‘username=admin’ -e 'password= --restart always --cap-add MKNOD collabora/code

  • I restarted both the Apache and Docker services.

After restarting these services, I could open, edit and save Office documents directly in the Nextcloud interface using Collabora. So again, I don’t know what fixed it. But it seems fixed.

I hope the fix stays after a reboot of the VPS but in theory, it should. I hope this helps someone else struggling with the same issue.

Somewhat to my surprise, the configuration above DOES survive a reboot of the VPS, so I guess that means it’s working now! Thank you @Sanook for the link.