After Upgrading to Nextcloud Hub 9 (30.0.6): “Socket Connection Failed” with Collabora – Even Demo Servers

Collabora “Socket Connection Failed” After Nextcloud Hub 9 (30.0.6) Update, Even with Demo Servers

I have two different Nextcloud setups:

  • Nextcloud A: Recently upgraded to Hub 9 (30.0.6)
  • Nextcloud B: Still on an older Nextcloud version (pre-30.0.6)

They both point to the same Collabora environment. One is my own Collabora server (Docker & reverse proxy), and I’ve also tested official Collabora demo servers. Here’s what’s odd:

  • Nextcloud B (older version) works fine with Collabora—no errors.

  • Nextcloud A (the updated instance) shows this message every time I open a document:

    “Socket connection could not be established or was unexpectedly closed. The reverse proxy may be misconfigured…”

Even if I switch Nextcloud A to use a Collabora demo server (which definitely works in other setups), I get the same error. Notably, before the Hub 9 update, Nextcloud A worked perfectly as well.


1) Redacted Config Overview

  1. Reverse Proxy (Apache)

    • Standard ProxyPass and ProxyPassMatch for /cool/(.*)/ws$ to handle WebSockets, plus SSL termination at Apache.
    • Configuration is effectively identical for both Nextcloud instances (just different hosts).
  2. Collabora

    • Docker container listening on 127.0.0.1:9980, environment variable domain=.* to allow any domain.
    • coolwsd.xml includes <alias_groups> for both Nextcloud hosts (protocol strings removed).
    • Collabora logs mention read-only systemplate warnings and missing shared presets—common but typically non-fatal.
  3. Nextcloud A (Hub 9 / 30.0.6)

    • Reinstalled the “Collabora Online” (richdocuments) app from scratch.
    • 'allow_local_remote_servers' => true in config.php.
    • Collabora URL set to either my own Collabora server or an official demo server.

Result:
Despite all these adjustments, Nextcloud A fails with the WebSocket/Socket error every time.


2) Error Details & Logs

  • Browser Error

    • “Socket connection could not be established or was unexpectedly closed…”
  • Nextcloud Logs

    • Occasionally an XML parse error: “Call to a member function xpath() on bool,” implying invalid WOPI discovery XML is returned (or Nextcloud thinks so).
  • Curl Tests

    • If I curl -I the Collabora /hosting/discovery endpoint from Nextcloud A’s server, I get valid XML—so basic connectivity is there.
  • Meanwhile, Nextcloud B (older version) + same Collabora config = no errors whatsoever.


3) Observations

  • The older Nextcloud setup (B) works fine, so the Collabora and reverse proxy configuration can’t be fundamentally broken.
  • Nextcloud A started having the socket issue only after upgrading to Hub 9 / version 30.0.6.
  • This happens with my local Collabora server and official Collabora demo servers—both are known to be properly configured.

Hence, it strongly suggests that something in Nextcloud A’s updated environment (possibly a new security measure or plugin conflict) is blocking or breaking the Collabora handshake.


4) Questions / Request for Help

  • Has anyone else encountered this “Socket connection failed” situation with Collabora specifically after moving to Nextcloud Hub 9 (30.0.x)?
  • Could there be new checks in the richdocuments app that kill the WOPI handshake or WebSockets?
  • Any pointers on debugging Nextcloud’s handling of Collabora’s discovery or the socket?

I’d be grateful for any insights or experiences. Thanks in advance!

Yes, I am experiencing the same error since 2 days. I’m already on Hub 10 and I cannot tell what the cause is because I did not change anything.

What I can say is that collabora crashes when I want to open a document:

wsd-00001-00039 2025-03-06 19:10:23.784357 +0000 [ docbroker_001 ] WRN  Cannot forward to unknown ClientSession [00c]: getclipboard| wsd/DocumentBroker.cpp:4824
wsd-00001-00039 2025-03-06 19:10:23.802575 +0000 [ docbroker_001 ] WRN  #38: Unassociated Kit (41) disconnected unexpectedly| wsd/COOLWSD.cpp:2925
wsd-00001-00039 2025-03-06 19:10:23.802597 +0000 [ docbroker_001 ] WRN  #38: Unknown Kit process closed with pid -1| wsd/COOLWSD.cpp:2936
wsd-00001-00024 2025-03-06 19:10:23.912743 +0000 [ asyncdns ] SIG   Fatal signal received: SIGABRT code: 18446744073709551610 for address: 0x3e900000001
Recent activity:
	coolwsd init
	initialized SSL
	spawning new forkit
	added child 31
	coolwsd accepting connections
	coolwsd running
	added child 38
	added child 36
	added child 37
	added child 41
	added child 42
	added child 43
	added child 44
	added child 45

Backtrace 1 - wsd 24.04.13.1 3dc280be53:
/usr/bin/coolwsd(_ZN7SigUtil13dumpBacktraceEv+0x73)[0x7fc6a3]
/usr/bin/coolwsd[0x7fcacd]
/lib/x86_64-linux-gnu/libc.so.6(+0x3c050)[0x7fb38fdae050]
/lib/x86_64-linux-gnu/libc.so.6(+0x8aebc)[0x7fb38fdfcebc]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x12)[0x7fb38fdadfb2]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7fb38fd98472]
/usr/bin/coolwsd[0x5be53f]
/lib/x86_64-linux-gnu/libc.so.6(+0x3c050)[0x7fb38fdae050]
/lib/x86_64-linux-gnu/libc.so.6(+0x152aab)[0x7fb38fec4aab]
/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt15basic_streambufIcSt11char_traitsIcEE6xsputnEPKcl+0x58)[0x7fb390197618]
/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l+0x16d)[0x7fb39018988d]
/usr/bin/coolwsd(_ZN10SocketPoll6wakeupEv+0xfb)[0x5ffc0b]
/usr/bin/coolwsd(_ZNSt17_Function_handlerIFvSt10shared_ptrI12StreamSocketEN3net18AsyncConnectResultEEZN4http7Session12asyncConnectER10SocketPollEUlS2_S4_E_E9_M_invokeERKSt9_Any_dataOS2_OS4_+0x25d)[0x66cb8d]
/usr/bin/coolwsd[0x843509]
/usr/bin/coolwsd(_ZN3net8AsyncDNS10resolveDNSEv+0x6dd)[0x846b1d]
/usr/bin/coolwsd[0xc20bd3]
/lib/x86_64-linux-gnu/libc.so.6(+0x891c4)[0x7fb38fdfb1c4]
/lib/x86_64-linux-gnu/libc.so.6(__clone+0x40)[0x7fb38fe7aac0]
kit-00045-00045 2025-03-06 19:10:24.082234 +0000 [ kit_spare_009 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195
kit-00044-00044 2025-03-06 19:10:24.082249 +0000 [ kit_spare_008 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195
kit-00043-00043 2025-03-06 19:10:24.082251 +0000 [ kit_spare_007 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195
kit-00042-00042 2025-03-06 19:10:24.082256 +0000 [ kit_spare_006 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195
frk-00026-00040 2025-03-06 19:10:24.082360 +0000 [ subforkit_001 ] ERR  #21: ForKit connection lost without exit arriving from wsd. Setting TerminationFlag| kit/ForKit.cpp:210
kit-00038-00038 2025-03-06 19:10:24.082473 +0000 [ kit_spare_004 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195
kit-00037-00037 2025-03-06 19:10:24.082528 +0000 [ kit_spare_003 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195
kit-00036-00036 2025-03-06 19:10:24.082533 +0000 [ kit_spare_002 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195
kit-00031-00031 2025-03-06 15:04:29.035801 +0000 [ kit_spare_001 ] INF  New kit client websocket inserted.| kit/Kit.cpp:3786
kit-00031-00031 2025-03-06 15:04:29.035803 +0000 [ kit_spare_001 ] INF  Kit initialization complete: setting log-level to [warning] as configured.| kit/Kit.cpp:3800
kit-00031-00031 2025-03-06 19:10:24.082610 +0000 [ kit_spare_001 ] ERR  #24: Kit for DocBroker [] connection lost without exit arriving from wsd. Setting TerminationFlag| kit/KitWebSocket.cpp:195

Can you check if it’s the same for you?

I just downgraded the Nextcloud Office app to 8.6.1 and now I can open documents. After updating to 8.6.2 it’s broken again. So it seems to be an issue with the new app.

I filed a bug report: Cannot open documents anymore: Socket connection could not be established or was unexpectedly closed · Issue #4551 · nextcloud/richdocuments · GitHub

How can I downgrade? I am not aware off that there is an official way to downgrade.