Nextcloud Office- Built-in-code Issue

Upgraded to (30.0.2) and now Office doesn’t work.

Could access the built-in CODE instance using ‘https://<MY_SERVER>/apps/richdocumentscode/proxy.php?req=/hosting/discovery

Any clue what could be the problem? On the prior 29.0.8 version, in built office worked.

Error at the configuration page - “Could not establish connection to the Collabora Online server”

Is there any way to pass a non-HTTP URL via occ command as server is behind a proxy? currently after a few tweaks, I am getting the below error.

Failed to connect to the remote server: cURL error 35: OpenSSL/3.0.13: error:0A00010B:SSL routines::wrong version number (see libcurl - Error Codes) for https://host.domain.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery

Nextcloud and CODE must use same URL scheme (and only https is supported by WOPI protocol)

Please review the Collabora integration guide and many many similar discussions tagged with collabora-built-in

Nextcloud is installed with Apache without SSL. and sits behind a SSL reverseproxy with offloading. All the URL tests as per the [Collabora integration guide] are successful

Previously Nextcloud was behind caddy reverse proxy , and after upgrade from v29 to v30 everything was broken .

Now switched to HAproxy , video uploads and browsing is stable.

Issue presist only with office documents/pdf handling ( .md and .drawio works fine)
For some reason when you click on “Use the built in code”

It connects and disconnect intermittently with following Error.

Your browser has been unable to connect to the Collabora server: http://cloud.host.net

This URL is determined on the Collabora server either from the configured URL or the server_name parameter in coolwsd.xml.

At the time of replying this thread, am getting below message that it connected but after sometime it might disconnect. why its picking http url instead of https while nextcloud instance is accessed with https ie. https://cloud.host.net/settings/admin/richdocuments?

Collabora Online server is reachable.

**URL used by the browser:** `http://cloud.host.net`
**Nextcloud URL used by Collabora:** `https://cloud.host.net` *(Determined from the browser URL)*

While its connected , When I try to open the a document its errors out with following error.

Document loading failed

Failed to load Nextcloud Office - please try again later

Nothing in Nextcloud logs.

Apache error logs looks like this…

==> /var/log/apache2/error.log <==

[Wed Dec 11 23:49:37.447332 2024] [authz_core:debug] [pid 377398:tid 140506969409216] mod_authz_core.c(815): [client 192.168.1.10-HAPROXY:42437] AH01626: authorization result of Require all granted: granted

[Wed Dec 11 23:49:37.447368 2024] [authz_core:debug] [pid 377398:tid 140506969409216] mod_authz_core.c(815): [client 192.168.1.10-HAPROXY:42437] AH01626: authorization result of <RequireAny>: granted

[Wed Dec 11 23:49:37.447412 2024] [proxy_fcgi:debug] [pid 377398:tid 140506969409216] mod_proxy_fcgi.c(123): [client 192.168.1.10-HAPROXY:42437] AH01060: set r->filename to proxy:fcgi://localhost//var/www/html/nextcloud/ocs/v2.php

[Wed Dec 11 23:49:37.447421 2024] [proxy:debug] [pid 377398:tid 140506969409216] mod_proxy.c(1521): [client 192.168.1.10-HAPROXY:42437] AH01143: Running scheme fcgi handler (attempt 0)

[Wed Dec 11 23:49:37.447428 2024] [proxy_fcgi:debug] [pid 377398:tid 140506969409216] mod_proxy_fcgi.c(1078): [client 192.168.1.10-HAPROXY:42437] AH01076: url: fcgi://localhost//var/www/html/nextcloud/ocs/v2.php proxyname: (null) proxyport: 0

[Wed Dec 11 23:49:37.447435 2024] [proxy_fcgi:debug] [pid 377398:tid 140506969409216] mod_proxy_fcgi.c(1087): [client 192.168.1.10-HAPROXY:42437] AH01078: serving URL fcgi://localhost//var/www/html/nextcloud/ocs/v2.php

[Wed Dec 11 23:49:37.447443 2024] [proxy:debug] [pid 377398:tid 140506969409216] proxy_util.c(2576): AH00942: FCGI: has acquired connection for (*:80)

[Wed Dec 11 23:49:37.447450 2024] [proxy:debug] [pid 377398:tid 140506969409216] proxy_util.c(2641): [client 192.168.1.10-HAPROXY:42437] AH00944: connecting fcgi://localhost//var/www/html/nextcloud/ocs/v2.php to localhost:8000

[Wed Dec 11 23:49:37.447463 2024] [proxy:debug] [pid 377398:tid 140506969409216] proxy_util.c(2677): [client 192.168.1.10-HAPROXY:42437] AH02545: fcgi: has determined UDS as /var/run/php/php8.3-fpm.sock

[Wed Dec 11 23:49:37.447618 2024] [proxy:debug] [pid 377398:tid 140506969409216] proxy_util.c(2864): [client 192.168.1.10-HAPROXY:42437] AH00947: connected //var/www/html/nextcloud/ocs/v2.php to httpd-UDS:0

[Wed Dec 11 23:49:37.447672 2024] [proxy:debug] [pid 377398:tid 140506969409216] proxy_util.c(3233): AH02823: FCGI: connection established with Unix domain socket /var/run/php/php8.3-fpm.sock (*:80)

[Wed Dec 11 23:49:37.447751 2024] [authz_core:debug] [pid 377398:tid 140506969409216] mod_authz_core.c(815): [client 192.168.1.10-HAPROXY:42437] AH01626: authorization result of Require all granted: granted

[Wed Dec 11 23:49:37.447763 2024] [authz_core:debug] [pid 377398:tid 140506969409216] mod_authz_core.c(815): [client 192.168.1.10-HAPROXY:42437] AH01626: authorization result of <RequireAny>: granted

[Wed Dec 11 23:49:37.757714 2024] [proxy:debug] [pid 377398:tid 140506969409216] proxy_util.c(2592): AH00943: FCGI: has released connection for (*:80)

Solved this issue by adding the below lines in the HAProxy backend pool, after realising it was a case of Mixed content. Now the office works (not very quickly as before); overall, the current Nextcloud version is not very fast but better now after introducing HAProxy.

http-request add-header X-Forwarded-Proto https
http-response set-header content-security-policy upgrade-insecure-requests

I am still curious why after upgrading I had to replace the Caddy reverse proxy server, which was working fine with the earlier releases, with HAProxy. What has changed?

Started facing issues immediately after upgrading to 29.0.10 , couldn’t upload or use Office. Upgraded to v30 assuming it will resolve the “bugs” if there are any.

It takes 11/12 seconds to open any office/pdf file. Is there any way we could improve it? and also there is a continuous stream of post messages on the browser side, is it normal?

XHRPOST
https://cloud.host.net/apps/richdocumentscode/proxy.php?req=/cool/https://cloud.host.net/index.php/apps/richdocuments/wopi/files/1072_oc101tfa2hav?access_token=p2Iccqy1I63eu4VT7rVLvFoGzvq0ANn7&access_token_ttl=0/ws?WOPISrc=https://cloud.host.net/index.php/apps/richdocuments/wopi/files/1072_oc101tfa2hav&compat=/ws/69dd1ca218a24dfff1161c3fc97eaae8/write/33
[HTTP/2 200  49ms]

I’m using separate CODE so I can’t say if built-in is slower. But likely the https/TLS offloading problem above has some affect. The URL shown in the settings in no everything. Nextcloud learns about capabilities and endpoints of CODE using the /hosting/discovery URL as shown per Collabora integration guide please review the XML document shows right https:// URLs. I think it learns the external URL from X-Forwarded-For headers which might be missing.

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