richdocumentscode icon indicating copy to clipboard operation
richdocumentscode copied to clipboard

Could not establish connection to the Collabora Online server.

Open kitatek opened this issue 3 years ago • 6 comments

Hello,

Information to reproduce:

My versions: Ubuntu VM 20.04 / docker installed as per nextcloud requirements Nextcloud 20 docker image Collabora Online 3.7.18 Collabora Online - Built-in CODE Server 6.4.705

  • a few other simple apps: Forms, Polls

Network is like this:

Internet | Firewall/NAT (80,443) | HAPROXY (SSL termination at frontend) (nextcloud.example.com:443) | VM with Docker (Nextcloud + Built-in CODE) (10.1.2.3.4)

Error message when trying to connect to CODE:

image

When switching to "Use you own server", I am getting the following URL (is that a hint for a bug ?) :

Collabora Online requires a seperate server acting as a WOPI-like Client to provide editing capabilities.

URL (and Port) of Collabora Online-server https://nextcloud.example.com/apps/richdocumentscode/proxy.php?req=

Any further information needed, please ask.

Any fix or workaround appreciated !

@timar any hints/clues to where to investigate or check logs ?

kitatek avatar Apr 14 '21 09:04 kitatek

I am having the same problem with nextcloud snap

Benjoban avatar Apr 14 '21 16:04 Benjoban

OK, I think I understand what the problem is:

  1. both browser and nextcloud server must connect to collabora URLs directly (I checked with client and server network inspections)
  2. because of that, the collabora URL must be using https
  3. so, the reverse proxy must handle SSL termination
  4. plus, the reverse proxy must handle websocket URLs rewriting too (with dynamic ID):
  # Main websocket
  ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:9980/lool/$1/ws nocanon

  1. therefore, as the reverse proxy rules guidance is only provided for Apache and nginx reverse proxies, one must devise the correct rule for haproxy
  2. finally, need to figure out how to configure the corresponding loolwsd settings ssl.enable=??? and ssl.termination=??? as lightly mentioned in Setting up Apache 2 reverse proxy.. (When using standalone collabora docker container instead of the built-in CODE, they seem to be in the docker container file /etc/loolwsd/loolwsd.xml but no documentation of it found anywhere. Not much documentation about built-in CODE loolwsd settings either).

I intend to work on that, will post here when it works.

In the mean time, if anyone already has that, I would love to get it.

The hints I found so far are just:

  1. Haproxy Proxypass: https://www.haproxy.com/blog/howto-write-apache-proxypass-rules-in-haproxy/ https://discourse.haproxy.org/t/proxypass-poxypassreverse-in-haproxy-howto/697/7
  2. Haproxy websockets: https://www.haproxy.com/blog/websockets-load-balancing-with-haproxy/
  3. Collabora loolwsd ssl settings: https://github.com/CollaboraOnline/online/issues/894

kitatek avatar Apr 14 '21 22:04 kitatek

Still not working on nextcloud 20, 3.7.19, 6.4.705

RobertRoberts2020 avatar Apr 27 '21 20:04 RobertRoberts2020

Put http://yourserver/apps/richdocumentscode/proxy.php?status in any browser, this will return a json like the following:

{
  "status": "starting"
}

It will never change to any other else.

neoacevedo avatar Aug 03 '21 23:08 neoacevedo

Do we have any updates on this issue? I am running NextCloud with the built-in CODE Server behind caddy.

Before I add nextcloud behind caddy I was able to access the CODE server now I am getting Could not establish connection to the Collabora Online server. error.

When I am opening the CODE Server URL I am seeing below error:

Screenshot_20211229_015019

Thank you!

groenator avatar Dec 29 '21 01:12 groenator

This is rather old, did you resolve your issues?

timur-g avatar Mar 29 '23 08:03 timur-g