Collabora Office failed to read document from storage

Hello.

I am having issues getting NextCloud set up to edit documents with Collabora Office.

I set up Collabora in a docker container. I assume it is working because I can go to https://office.[domain].com/hosting/discovery and load the page.

I then installed the “Nextcloud Office” app and set the URL of Collabora Online-server on the Nextcloud Office configuration page.

When I click on a document to edit it I get the following error message:

Document loading failed
Failed to read document from storage, please try to load the document again.
Please check the Collabora Online server log for more details and make sure that Nextcloud can be reached from there.

I tried some things including setting the “Allow list for WOPI requests” to ,0.0.0.0/0 as suggested on https://github.com/nextcloud/all-in-one/discussions/1358.

I am not sure if the setting is holding because after I press the arrow at the end of the box it just goes back to being empty.

image

Looking at the container log I see:

nextcloud-collabora-1 | wsd-00001-00051 2024-02-20 13:59:53.875748 -0800 [ docbroker_004 ] ERR #18: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1137
nextcloud-collabora-1 | wsd-00001-00051 2024-02-20 13:59:53.875789 -0800 [ docbroker_004 ] WRN #18: Unassociated Kit (50) disconnected unexpectedly| wsd/COOLWSD.cpp:3851
nextcloud-collabora-1 | frk-00026-00026 2024-02-20 13:59:53.916380 -0800 [ forkit ] WRN The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to copy sysTemplate to jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:529
nextcloud-collabora-1 | sh: 1: /usr/bin/coolmount: Operation not permitted
nextcloud-collabora-1 | sh: 1: /usr/bin/coolmount: Operation not permitted
nextcloud-collabora-1 | sh: 1: /usr/bin/coolmount: Operation not permitted

Connecting to the collabora container from the nextcloud docker container works fine:

$ sudo docker exec -it nextcloud-app-1 bash
$ curl -vvv https://office.[domain].com/hosting/discovery
* Trying 173.224.xxx.53:443...
* Connected to office.[domain].com (173.224.xxx.53) port 443 (#0)
[...]
< HTTP/2 200
< server: nginx/1.25.3
< date: Tue, 20 Feb 2024 22:16:25 GMT
< content-type: text/xml
< content-length: 29829
[…]

However, connecting to the nextcloud container from the collabora docker container results in a Connection refused error.

$ sudo docker exec -it nextcloud-collabora-1 bash
$ curl -vvv https://nextcloud.[domain].com/standalone-signaling/api/v1/welcome
*   Trying 172.20.0.6:443...
* connect to 172.20.0.6 port 443 failed: Connection refused
* Failed to connect to nextcloud.[domain].com port 443 after 1 ms: Couldn't connect to server
* Closing connection 0
curl: (7) Failed to connect to nextcloud.[domain].com port 443 after 1 ms: Couldn't connect to server
$ curl -vvv https://nextcloud.[domain].com/ocs/v2.php/apps/serverinfo/api/v1/info
*   Trying 172.20.0.6:443...
* connect to 172.20.0.6 port 443 failed: Connection refused
* Failed to connect to nextcloud.[domain].com port 443 after 1 ms: Couldn't connect to server
* Closing connection 0
curl: (7) Failed to connect to nextcloud.[domain].com port 443 after 1 ms: Couldn't connect to server

Any suggestions of what I should try next?

Thanks for your help.

I though of one more thing to try. I switched to http when connecting to the nextcloud container from the collabora docker container and that seemed to connect. I have the nginxproxy/nginx-proxy docker container sitting in front of these and turned off ssl on the Collabora container because it would not work with the proxy with it on. Still not sure how to make it work.

$ sudo docker exec -it nextcloud-collabora-1 bash
$ curl -vvv http://nextcloud.[domian].com/standalone-signaling/api/v1/welcome
*   Trying 172.20.0.6:80...
* Connected to nextcloud.[domian].com (172.20.0.6) port 80 (#0)
> GET /standalone-signaling/api/v1/welcome HTTP/1.1
> Host: nextcloud.[domian].com
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 404 Not Found
...
$ curl -vvv http://nextcloud.[domian].com/ocs/v2.php/apps/serverinfo/api/v1/info
*   Trying 172.20.0.6:80...
* Connected to nextcloud.[domian].com (172.20.0.6) port 80 (#0)
> GET /ocs/v2.php/apps/serverinfo/api/v1/info HTTP/1.1
> Host: nextcloud.[domian].com
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 401 Unauthorized
...

curl output shows different IP addreses:

looks you connect with office… through public IP but use private rfc1918 IP address for nextcloud… maybe you created local DNS record and use splitbraindns to access your Nextcloud domain? definitely the second connection fails for some reason… likely you don’t hit the reverse proxy but some other system which doesn’t listen on this address (or you directly hit Nextcloud container behind the reverseproxy).

you can look at this post how to avoid internet loop and make your containers connect directly to the reverseproxy using public DNS names (call it “splitbraindns for docker”)

btw: you better use https://nextcloud.mydomain.tld/status.php it is unauthorized and lightweight - you see immediately if it works :wink:

Thanks. That helped with connection to the nextcloud container but I still cannot edit documents.

$ sudo docker exec -it nextcloud-collabora-1 bash
$ curl -vvv http://nextcloud.[domain].com/status.php
*   Trying 172.20.0.6:80...
* Connected to nextcloud.[domain].com (172.20.0.6) port 80 (#0)
> GET /status.php HTTP/1.1
> Host: nextcloud.[domain].com
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 200 OK

I get this in the logs when trying to edit a document. I clipped the tags of the front of the lines so it is easer to read.

frk-00026-00026 2024-02-21 18:30:04.852876 -0800 [ forkit ] WRN  The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to copy sysTemplate to jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:529
wsd-00001-00083 2024-02-21 18:30:04.855319 -0800 [ docbroker_005 ] ERR  WOPI::CheckFileInfo failed for URI [https://nextcloud.[domain].com//index.php/apps/richdocuments/wopi/files/1537313_octlo6skqqlh?access_token=TuF3U7EhQ5cfcWzfuPzRnBc175x9LuAx&access_token_ttl=0]: 0 (Unknown) . Headers:        Body: []| wsd/Storage.cpp:708
wsd-00001-00083 2024-02-21 18:30:04.855470 -0800 [ docbroker_005 ] ERR  loading document exception: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:2679
wsd-00001-00083 2024-02-21 18:30:04.855530 -0800 [ docbroker_005 ] ERR  Failed to add session to [https%3A%2F%2Fnextcloud.[domain].com%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1537313_octlo6skqqlh] with URI [https://nextcloud.[domain].com//index.php/apps/richdocuments/wopi/files/1537313_octlo6skqqlh?access_token=TuF3U7EhQ5cfcWzfuPzRnBc175x9LuAx&access_token_ttl=0]: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:2641
wsd-00001-00083 2024-02-21 18:30:04.855592 -0800 [ docbroker_005 ] ERR  Storage error while starting session on https%3A%2F%2Fnextcloud.[domain].com%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1537313_octlo6skqqlh for socket #25. Terminating connection. Error: WOPI::CheckFileInfo failed: | wsd/COOLWSD.cpp:5438
wsd-00001-00083 2024-02-21 18:30:04.856081 -0800 [ docbroker_005 ] WRN  ClientSession must be known| wsd/DocumentBroker.cpp:3647
wsd-00001-00083 2024-02-21 18:30:04.876550 -0800 [ docbroker_005 ] ERR  #18: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1137
wsd-00001-00083 2024-02-21 18:30:04.876624 -0800 [ docbroker_005 ] WRN  #18: Unassociated Kit (76) disconnected unexpectedly| wsd/COOLWSD.cpp:3855
wsd-00001-00085 2024-02-21 18:30:05.124900 -0800 [ docbroker_006 ] ERR  WOPI::CheckFileInfo failed for URI [https://nextcloud.[domain].com//index.php/apps/richdocuments/wopi/files/1537313_octlo6skqqlh?access_token=TuF3U7EhQ5cfcWzfuPzRnBc175x9LuAx&access_token_ttl=0&permission=edit]: 0 (Unknown) . Headers:        Body: []| wsd/Storage.cpp:708
wsd-00001-00085 2024-02-21 18:30:05.124940 -0800 [ docbroker_006 ] ERR  loading document exception: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:2679
wsd-00001-00085 2024-02-21 18:30:05.124953 -0800 [ docbroker_006 ] ERR  Failed to add session to [https%3A%2F%2Fnextcloud.[domain].com%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1537313_octlo6skqqlh] with URI [https://nextcloud.[domain].com//index.php/apps/richdocuments/wopi/files/1537313_octlo6skqqlh?access_token=TuF3U7EhQ5cfcWzfuPzRnBc175x9LuAx&access_token_ttl=0&permission=edit]: WOPI::CheckFileInfo failed: | wsd/DocumentBroker.cpp:2641
wsd-00001-00085 2024-02-21 18:30:05.124965 -0800 [ docbroker_006 ] ERR  Storage error while starting session on https%3A%2F%2Fnextcloud.[domain].com%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1537313_octlo6skqqlh for socket #25. Terminating connection. Error: WOPI::CheckFileInfo failed: | wsd/COOLWSD.cpp:5438
wsd-00001-00085 2024-02-21 18:30:05.125039 -0800 [ docbroker_006 ] WRN  ClientSession must be known| wsd/DocumentBroker.cpp:3647
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
wsd-00001-00085 2024-02-21 18:30:05.131964 -0800 [ docbroker_006 ] ERR  #18: Read failed, have 0 buffered bytes (ECONNRESET: Connection reset by peer)| net/Socket.hpp:1137
wsd-00001-00085 2024-02-21 18:30:05.131995 -0800 [ docbroker_006 ] WRN  #18: Unassociated Kit (84) disconnected unexpectedly| wsd/COOLWSD.cpp:3855
frk-00026-00026 2024-02-21 18:30:05.169317 -0800 [ forkit ] WRN  The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to copy sysTemplate to jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:529
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted

I think the problem remains the same - your Collabora can’t reach Nextcloud.

as long you access your cloud using https:// it’s pointless to rely on http:// tests - you must allow communication between all the systems using https://.

please work through Collabora integration guide

Good point. Https does not work. I will work through that guide later. Thank you for the link.

$ sudo docker exec -it nextcloud-collabora-1 bash
$ curl -vvv https://nextcloud.[domian].com/status.php
*   Trying 172.20.0.6:443...
* connect to 172.20.0.6 port 443 failed: Connection refused
* Failed to connect to nextcloud.[domian].com port 443 after 5 ms: Couldn't connect to server
* Closing connection 0
... 

I worked through most of the Collabora integration guide. It is very helpful but I still have not sorted out my issue. I believe I confirmed my suspicion about routing through the proxy. I did a traceroute from both docker containers.

From the collabora container a traceroute to nextcloud has one hop to nextcloud container:

$ traceroute nextcloud.[domain].com
traceroute to nextcloud.[domain].com (172.20.0.6), 30 hops max, 60 byte packets
 1  nextcloud-app-1.nextcloud_default (172.20.0.6)  0.053 ms  0.027 ms  0.025 ms

That makes sense. Since it does not go through the proxy it cannot access the https connection.

From the nextcloud container a traceroute to collabora has two hops through the default gateway:

$ traceroute office.[domain].com
traceroute to office.[domain].com (173.224.xxx.53), 30 hops max, 60 byte packets
 1  nextcloud (172.20.0.1)  0.084 ms  0.044 ms  0.029 ms
 2  ip-173-224-xxx-53.syringanetworks.net (173.224.xxx.53)  0.204 ms  0.156 ms  0.162 ms

I was trying to figure out what the difference is. I had about given up when I noticed I had set the hostname in the docker-compose.yml file for Next Cloud. I removed that and am able to open a document now. Thanks for your help.

2 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.