Nextcloud Collabora CODE integration not working properly

Following the steps in Collabora integration guide

On Nextcloud server (WAN: office)

./occ config:app:get richdocuments wopi_url =>
https://collab.kingma.ch

curl -I https://collab.kingma.ch/hosting/discovery

HTTP/1.1 200 OK
Server: openresty
Date: Tue, 15 Jul 2025 08:20:49 GMT
Content-Type: text/xml
Content-Length: 32276
Connection: keep-alive
Last-Modified: Tue, 15 Jul 2025 08:20:49
X-Content-Type-Options: nosniff
X-My-Custom-Header: SomeValue

The content: to large and uploads of .txt not allowed

On Collabora server (WAN: collab)

curl https://office.kingma.ch/status.php

{“installed”:true,“maintenance”:false,“needsDbUpgrade”:false,“version”:“31.0.7.1”,“versionstring”:“31.0.7”,“edition”:“”,“productname”:“Nextcloud”,“extendedSupport”:false}bash-5.2

In the administrator settings:

Collabora Online server is reachable.

Collabora Online Development Edition 25.04.3.2 9d9a449949

URL used by the browser: https://collab.kingma.ch
Nextcloud URL used by Collabora: https://office.kingma.ch (Determined from the browser URL)

In Nextcloud loading a docx document results in

Failed to load Nextcloud Office - please try again later

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

  • Nextcloud Server version:
    • Nextcloud 31.0.7
  • Operating system and version:
    • #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26)
  • Web server and version:
    • Server version: Apache/2.4.62 (Debian)
  • Reverse proxy and version:
    • nginx version: openresty/1.27.1.2
  • PHP version:
    • PHP 8.3.23 (cli) (built: Jul 3 2025 23:52:34) (NTS)
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • prob direct after installation
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • OMV Container
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • nope

Configuration

Nextcloud

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "srv-nas-pi.kingma:8080",
            "office.kingma.ch",
            "office.king.ma"
        ],
        "overwrite.cli.url": "https:\/\/office.kingma.ch",
        "overwriteprotocol": "https",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.7.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smpttimeout": 30,
        "mail_smtpsecure": "ssl",
        "loglevel": 3,
        "maintenance": false,
        "maintenance_window_start": 3,
        "default_phone_region": "CH",
        "app_install_overwrite": []
    }
}

Apps

Enabled:

  • activity: 4.0.0
  • admin_audit: 1.21.0
  • app_api: 5.0.2
  • bruteforcesettings: 4.0.0
  • calendar: 5.3.5
  • circles: 31.0.0
  • cloud_federation_api: 1.14.0
  • comments: 1.21.0
  • contacts: 7.1.5
  • contactsinteraction: 1.12.0
  • cookbook: 0.11.3
  • dashboard: 7.11.0
  • dav: 1.33.0
  • encryption: 2.19.0
  • federatedfilesharing: 1.21.0
  • federation: 1.21.0
  • files: 2.3.1
  • files_downloadlimit: 4.0.0
  • files_external: 1.23.0
  • files_pdfviewer: 4.0.0
  • files_reminders: 1.4.0
  • files_sharing: 1.23.1
  • files_trashbin: 1.21.0
  • files_versions: 1.24.0
  • firstrunwizard: 4.0.0
  • fulltextsearch: 31.0.0
  • groupfolders: 19.1.2
  • logcleaner: 1.1.8
  • logreader: 4.0.0
  • lookup_server_connector: 1.19.0
  • nextcloud_announcements: 3.0.0
  • notes: 4.12.2
  • notifications: 4.0.0
  • oauth2: 1.19.1
  • password_policy: 3.0.0
  • photos: 4.0.0
  • privacy: 3.0.0
  • profile: 1.0.0
  • provisioning_api: 1.21.0
  • recommendations: 4.0.0
  • related_resources: 2.0.0
  • richdocuments: 8.7.2
  • serverinfo: 3.0.0
  • settings: 1.14.0
  • sharebymail: 1.21.0
  • support: 3.0.0
  • survey_client: 3.0.0
  • suspicious_login: 9.0.1
  • systemtags: 1.21.1
  • text: 5.0.0
  • theming: 2.6.1
  • twofactor_backupcodes: 1.20.0
  • twofactor_nextcloud_notification: 5.0.0
  • twofactor_totp: 13.0.0-dev.0
  • updatenotification: 1.21.0
  • user_status: 1.11.0
  • viewer: 4.0.0
  • weather_status: 1.11.0
  • webhook_listeners: 1.2.0
  • workflowengine: 2.13.0
    Disabled:
  • richdocumentscode_arm64: 25.4.202 (installed 25.4.202)
  • user_ldap: 1.22.0 (installed 1.22.0)

from the log

[richdocuments] Error: Failed to fetch discovery: cURL error 28: Connection timed out after 5000 milliseconds (see libcurl - Error Codes) for https://collab.kingma.ch/hosting/discovery
from ? by – at 15 Jul 2025, 09:10:12

Interesting as the URL works fine both from within nextcloud server as well as the browser.

WSS (WebSockets Support) for https://collab.kingma.ch enabled?

1 Like

WSS (WebSockets Support) for https://collab.kingma.ch enabled?

Good question. In all the docs I checked I never came across that requirement :joy:

Is this in the collabora server? nextcloud? the proxy? the router?

EDIT: added the following to the collab proxy:

The error remained

in the reverse proxy configuration:

  1. Install Docker on host
  2. Create a DNS entry for subdomain like office.mydomain.tld
  3. Set reverse proxy host for office domain to forward and encrypt HTTP & WSS (WebSockets Support) for port 9980 to https://office.mydomain.tld.
1 Like

In the collabora log files I see this when I attempt to open a docx:

wsd-00001-00020 2025-07-15 13:50:16.149550 +0200 [ asyncdns ] DBG #44 New socket connected to office.kingma.ch:443 (SSL)| net/NetUtil.cpp:516
wsd-00001-00020 2025-07-15 13:50:16.149565 +0200 [ asyncdns ] DBG SocketPoll [websrv_poll] thread is already running.| net/Socket.cpp:425
wsd-00001-00020 2025-07-15 13:50:16.252294 +0200 [ asyncdns ] DBG #45: Created socket. Thread affinity set to 0x7fff9909f020, Socket[#45, IPv4 @ :0]| net/Socket.hpp:472
wsd-00001-00020 2025-07-15 13:50:16.253419 +0200 [ asyncdns ] DBG #45 New socket connected to office.kingma.ch:443 (SSL)| net/NetUtil.cpp:516
wsd-00001-00030 2025-07-15 13:50:16.252033 +0200 [ websrv_poll ] DBG #44: SslStreamSocket::shutdownConnection() #44| net/SslSocket.hpp:136
wsd-00001-00030 2025-07-15 13:50:16.252126 +0200 [ websrv_poll ] DBG #44: SslStreamSocket::shutdownConnection() #44| net/SslSocket.hpp:136
wsd-00001-00030 2025-07-15 13:50:16.252226 +0200 [ websrv_poll ] DBG #44: Closed socket Socket[#44, IPv4 @ :0]| net/Socket.hpp:503
wsd-00001-00030 2025-07-15 13:50:16.255007 +0200 [ websrv_poll ] DBG #45: SSL error (handshake): WANT_READ (2), rc: -1, errno: 11 (EAGAIN: Resource temporarily unavailable): BIO error: 0: error:00000000:lib(0)::reason(0):expressionless: net/SslSocket.hpp:387
wsd-00001-00030 2025-07-15 13:50:16.255041 +0200 [ websrv_poll ] DBG #45: SSL error (handshake): WANT_READ (2), rc: -1, errno: 11 (EAGAIN: Resource temporarily unavailable): BIO error: 0: error:00000000:lib(0)::reason(0):expressionless: net/SslSocket.hpp:387
wsd-00001-00030 2025-07-15 13:50:16.274238 +0200 [ websrv_poll ] DBG #45: SSL error (read): WANT_READ (2), rc: -1, errno: 11 (EAGAIN: Resource temporarily unavailable): BIO error: 0: error:00000000:lib(0)::reason(0):expressionless: net/SslSocket.hpp:387
wsd-00001-00030 2025-07-15 13:50:16.277608 +0200 [ websrv_poll ] DBG #45: SSL error (read): WANT_READ (2), rc: -1, errno: 11 (EAGAIN: Resource temporarily unavailable): BIO error: 0: error:00000000:lib(0)::reason(0):expressionless: net/SslSocket.hpp:387

Just for my pease of mind: The word wss nor websocket does not appear in https://help.nextcloud.com/t/collabora-integration-guide/151879
Adding it might be a help?

well did that solve your issue at all? that would be great! :+1:

  • presumably its specific to the reverse proxy?
  • if it did solve you issue and you need that peace of mind, maybe @wwe would consider adding that somewhere

Yeah that would’ve been great allas. Still getting Failed to load Nextcloud office. This is richdocuments settings:

"apps": {
    "richdocuments": {
        "canonical_webroot": "",
        "disable_certificate_verification": "",
        "doc_format": "ooxml",
        "edit_groups": "kingmas",
        "enabled": "yes",
        "external_apps": "",
        "installed_version": "8.7.2",
        "public_wopi_url": "https:\/\/collab.kingma.ch",
        "types": "filesystem,prevent_group_restriction",
        "wopi_callback_url": "",
        "wopi_url": "https:\/\/collab.kingma.ch"
    }
}

Interesting I see this url in devtools :slight_smile:

https://collab/.kingma/.ch/browser/9d9a449949/images/lc_searchprev.svg

That doesn’t seem right. Why is it using slashes for each . ?

are you suggesting the error only appears when loading docx files?

try removing all options and see if that works:

see also recommended NPM settings:

Be aware of the syntax for defining client domains using \\ as separator before .

- =https://cloud\\.mydomain\\.tld:443

Ok. this was it (and wss?). Not sure in which of the many well intended nextcloud/collabora CODE integration documents (there are at least half a dozen when I stopped counting) it said to escape . dots in the yaml docker file but in case of OMV Compose this definitely is wrong.

My yaml:

networks:
  proxy:
    external: true

services:
  collabora:
    image: collabora/code:latest
    container_name: collabora
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp=unconfined  
    ports: ['192.168.1.20:9980:9980']
    networks: ['proxy']
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
#     -  CHANGE_TO_COMPOSE_DATA_PATH/coolwsd:/etc/coolwsd
    environment:
      - domain=office.kingma.ch       # <== look mam, no / !
      - server_name=collab.kingma.ch  # <== and not here either.
      - extra_params=
        --o:ssl.enable=false
        --o:ssl.termination=true
        --o:logging.level=debug
      - TZ=Europe/Zurich
      - username=${COLLABORA_USER}
      - password=${COLLABORA_PASS}

If only the girls and guys @ collabora would be so nice to document what all these mean.

so that’s solved now… all working?

Thanks scubamuc. It does indeed work now.

(it took me a bit longer than expected though…)

Time to update GitHub - theking2/srv-nas-pi

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