all-in-one icon indicating copy to clipboard operation
all-in-one copied to clipboard

Make collabora work behind Apache

Open charredchar opened this issue 2 years ago • 26 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Install Nextcloud AIO following the steps in readme.md. Enable the Collabora container from the AIO Interface.
  2. Open any .docx or .odt file.

Expected behavior

Collarbora/Nextcloud Office loads the file in the browser

Actual behavior

I receive an error, "Document Loading failed. Failed to load Nextcloud Office - please try again later"

Host OS

Ubuntu Server 20.04 in a Windows Server Hyper-V VM.

Nextcloud AIO version

Nextcloud AIO v1.4.0

Current channel

Latest, attempted Beta with the same results.

Other valuable info

I am currently running Nextcloud through an Apache Reverse Proxy located on another VM. I followed the setup under reverse-proxy.md including the VirtualHosts and startup command. Everything except for Collabora works perfectly as expected. I wouldn't mind testing without a reverse proxy at all, using just the server IP, for testing but I couldn't get through the AIO setup without a domain entered. I've tried it in Edge, Chrome and Firefox. Adblock disabled.

AIO Apache Log; https://pastebin.com/7VNKQw29 AIO Nextcloud Log; https://pastebin.com/NcnBpz4C Chrome Console while loading file; https://pastebin.com/YRxkR55L AIO Collabora log is too large for Pastebin.

charredchar avatar Jun 18 '22 05:06 charredchar

@Cr0iX am I correct that you are running AIO behind Apache? If yes, is it possible for you to reproduce this issue?

szaimen avatar Jun 18 '22 07:06 szaimen

@Cr0iX am I correct that you are running AIO behind Apache? If yes, is it possible for you to reproduce this issue?

Yes that is correct.

I have just tried to run nextcloud-aio with collabora instead of onlyoffice, and i can confirm that the error "Document loading failed" is back. I've tried both .odt and .docx, and both have the same error.

Pulling the updates to see if stuff changes. Still same error with latest docker versions.

I get this error from nextcloud-aio-nextcloud: nextcloud-aio-apache | {"level":"error","ts":1655665353.162254,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"write tcp 172.21.0.9:11000->172.21.0.1:55152: write: broken pipe"}

Cr0iX avatar Jun 19 '22 18:06 Cr0iX

I see. Thanks for providing the log!

Can you check if adding ProxyPreserveHost On makes it work? Thank you!

szaimen avatar Jun 19 '22 19:06 szaimen

It doesn't. I already had that in my config.

Cr0iX avatar Jun 19 '22 19:06 Cr0iX

Thanks! No idea how to work around this then...

szaimen avatar Jun 19 '22 19:06 szaimen

Can you send your browser console logs when opening the document?

szaimen avatar Jun 19 '22 23:06 szaimen

I see @charredchar already provided this info...

szaimen avatar Jun 19 '22 23:06 szaimen

It seems like simply websockets do not work as intended...

szaimen avatar Jun 19 '22 23:06 szaimen

Hi there, just for information maybe it can help..

I had same error on Collabora at fresh install. The ONLY way i make it work is with a TRUE certificate (no self-signed...)

Maybe you can test is you use self-signed certificate.

I used true certificate (letsencrypt) with reverse proxy (haproxy) in another VM like you.

Regards

crocobc avatar Jun 20 '22 11:06 crocobc

No, we only use certificates from letsencrypt here so this should not be the problem...

szaimen avatar Jun 20 '22 11:06 szaimen

Somehow the websocket connection seems to fail. This seems to be caused by collabora not sending the upgrade websocket header nor the connection upgrade variable. But I may be wrong here since this would probably mean that it would fail behind other reverse proxies, too...

szaimen avatar Jun 20 '22 11:06 szaimen

https://github.com/nextcloud/all-in-one/pull/835 makes the push proxy work behind apache which did not work, too...

szaimen avatar Jun 20 '22 11:06 szaimen

I see. Thanks for providing the log!

Can you check if adding ProxyPreserveHost On makes it work? Thank you!

I have this enabled already as well, as it is part of the config on the reverse-proxy.md doc.

Hi there, just for information maybe it can help..

I had same error on Collabora at fresh install. The ONLY way i make it work is with a TRUE certificate (no self-signed...)

Maybe you can test is you use self-signed certificate.

I used true certificate (letsencrypt) with reverse proxy (haproxy) in another VM like you.

Regards

I have true certificates using LetsEncrypt with all subdomains through my Apache reverse proxy. I don't know what Nextcloud might be doing on the backend though as attempting to connect to IP:Port just forwards to my domain address anyway.

Should Collabora be accessible through IP:Port as well? I can not seem to access it.

charredchar avatar Jun 20 '22 21:06 charredchar

Should Collabora be accessible through IP:Port as well? I can not seem to access it.

No it shouldn'. It should just work without any additional work which is not the case because something does not work as expected with the apache reverse proxy documentation.

However curently not sure what to change to make it work.

szaimen avatar Jun 20 '22 21:06 szaimen

No, it does not necessarily need to be on a subdomain as it works for all other reverse proxies with the same domain only not for apache in front of AIO...

szaimen avatar Jun 27 '22 08:06 szaimen

I was just trying to share how I got it to work. It would be perfect if a subdomain is not needed, as this would solve the issue I mentioned above :-)

As I said it works for all reverse proxies with the same domain and only seems to be a problem with apache in front of it...

szaimen avatar Jun 27 '22 08:06 szaimen

Unfortunately I was not able to find a solution to this so some help on this is appreciated!

szaimen avatar Jul 04 '22 14:07 szaimen

What can we provide to try to identify the problem?

SamuXzX avatar Jul 04 '22 21:07 SamuXzX

What can we provide to try to identify the problem?

You can try to improve the reverse proxy documentation for Apache that makes Collabora that is bundled within AIO work.

szaimen avatar Jul 04 '22 21:07 szaimen

Do you confirm that you referred to this guide to set up a Collabora docker container? https://collabora-online-for-nextcloud.readthedocs.io/en/latest/install/

SamuXzX avatar Jul 05 '22 10:07 SamuXzX

Seems like there is now a problem with Nginx, too. We could try to downgrade the collabora container and see if it fixes the issue. Do you remember with which AIO version it worked the last time?

szaimen avatar Jul 10 '22 19:07 szaimen

If I remember cotrectly, it used to work before the aio 1.4.0 update which included a collabora upgrade. I'll try to verify this week if using the 21.11.4.2.1 collabora image works. If yes I will see if it is possible to downgrade or if there is any other solution to this

szaimen avatar Jul 24 '22 20:07 szaimen

Any news on this? I have the same problem here, and I cannot get Collabora working on AIO at all :-(

ckauhaus avatar Aug 04 '22 13:08 ckauhaus

Collabora has changed their settings, here is the solution: https://help.nextcloud.com/t/solved-another-failed-to-load-collabora-online-please-try-again-later-problem/111473/39?u=esmailelbob Can it be applied to AIO?

albert-gee avatar Sep 18 '22 21:09 albert-gee

https://help.nextcloud.com/t/solved-another-failed-to-load-collabora-online-please-try-again-later-problem/111473/39?u=esmailelbob

This is already applied and working with all documented reverse proxies except Apache. I haven't figured out a way what needs to be changed in the Apache reverse proxy config in order to make it work. Your help in doing so is very welcome!

I am talking about changes to this config: https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#apache

szaimen avatar Sep 18 '22 21:09 szaimen

We can't improve the config if we don't know what's the problem. We need some logs

SamuXzX avatar Sep 19 '22 21:09 SamuXzX

So, I made multiple attempts to find a working Apache config for this but everytime it fails to establish the websocket connection. I'll see together with @juliushaertl if we find the reason and a solution to this.

szaimen avatar Sep 26 '22 17:09 szaimen

I have nextcloud-aio running behind nginx-proxy-manager with lets encrypt certificate.

I also have the problem in the admin settings that nextcloud thinks it can't connect to the Collabora Online server.

As soon as I adjust the URL to access it without reverse proxy the settings turn green. (http://IP:11000) But it still does not work after you press save the settings are red again and it complains that different protocols are used. (http/https)

Heggeg avatar Sep 26 '22 21:09 Heggeg

This is still a problem for me, on NGINX as well. The issue concerning NGINX has been closed for some reason. Any guidance?

TheManchineel avatar Oct 01 '22 23:10 TheManchineel

NGINX as well.

Ah interesting! I didn't know.

szaimen avatar Oct 01 '22 23:10 szaimen