<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Collabora 26.04: compact WebSocket URL /cool/ws is not proxied as a WebSocket upgrade → intermittent "Document loading failed"]]></title><description><![CDATA[<p dir="auto">I'm a user/admin who is getting frustrated by frequent "Document loading failed" errors. I tried to work out what was going on, with the help of an LLM, and it concluded that there was nothing I could do personally. Happy to provide more info if there's anything I can provide.</p>
<p dir="auto">Here's a bug report that the LLM drafted. Exercise cynicism.</p>
<hr />
<blockquote>
<p dir="auto"><img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/26a0.png?v=cb8b82e1523" class="not-responsive emoji emoji-android emoji--warning" style="height:1.4em;width:auto;vertical-align:middle" title="⚠" alt="⚠" />️ Authorship note: This report was drafted by a large language model (AI assistant) from server logs, browser-console output, and a debugging session. The log excerpts, config excerpts, and command outputs below are from the real system and are believed accurate; the root-cause analysis and proposed patch are LLM inferences and have not been confirmed by a human expert. Please verify before acting. The human reporter is a non-expert and can supply full logs and run further diagnostics on request.</p>
</blockquote>
<h2>Summary</h2>
<p dir="auto">On a Cloudron instance, opening office documents from Nextcloud intermittently fails with "Document loading failed / Failed to load Nextcloud Office (Collabora)". The failure is transient: retrying often works, and sometimes the document appears after a short wait without any page reload.</p>
<p dir="auto">Root cause (as analysed): the Collabora app container ships a correct nginx config in <code>/etc/nginx/snippets/coolwsd.conf</code>, but the active <code>/etc/nginx/nginx.conf</code> does not include it. The active config has a WebSocket-upgrade location only for the legacy URL form <code>/cool/&lt;encoded-wopisrc&gt;/ws</code>. Collabora 26.04's new compact WebSocket URL <code>/cool/ws?WOPISrc=…</code> does not match it, falls through to a generic location <code>~ ^/(c|l)ool</code> that does not set the upgrade headers, and coolwsd rejects it with HTTP 400 Invalid or unknown request. The client then intermittently falls back to the legacy URL, which is upgraded — which is why loading is flaky and self-heals.</p>
<h2>Environment</h2>
<ul>
<li>Cloudron, with the Collabora Online (CODE) app and the Nextcloud app (Nextcloud Office / richdocuments)</li>
<li>Collabora Online Development Edition 26.04.4.2</li>
<li>Nextcloud: <a href="https://files.radicalroutes.org.uk/" target="_blank" rel="noopener noreferrer nofollow ugc">https://files.radicalroutes.org.uk/</a> · Collabora: <a href="https://https" target="_blank" rel="noopener noreferrer nofollow ugc">https://https</a>://docs.radicalroutes.org.uk/</li>
<li>Both apps reported up to date (Collabra: 1.60.0, Nextcloud: 5.8.10)</li>
</ul>
<h2>Evidence</h2>
<ol>
<li>Browser console, during a failure</li>
</ol>
<pre><code>GET wss://docs.example.org.uk/cool/ws?WOPISrc=https://files.example.org.uk/…/wopi/files/248470_…&amp;…&amp;compat=
    [HTTP/1.1 400 (Bad Request) 323ms]
Firefox can't establish a connection to the server at wss://docs.example.org.uk/cool/ws?WOPISrc=…
Document loading failed due to timeout: Please check for failing network requests
</code></pre>
<ol start="2">
<li><code>coolwsd log</code> — compact URL is not upgraded</li>
</ol>
<pre><code>ERR #73: Bad request: GET HTTP/1.0 /cool/ws?WOPISrc=…&amp;access_token=test, content-length: -1, chunked: false,
         Host: localhost:8000 / Connection: close / …  closeConnection: true
         …: Invalid or unknown request. |wsd/ClientRequestDispatcher.cpp:1721
"GET /cool/ws?WOPISrc=… HTTP/1.1" 400 0
</code></pre>
<p dir="auto">The request arrives as <strong><code>HTTP/1.0 with Connection: close</code></strong> — i.e. nginx forwarded it without the WebSocket upgrade. This happens both from the container's own nginx and through Cloudron's host proxy (public URL), so both layers fail to upgrade <code>/cool/ws</code>.</p>
<ol start="3">
<li>Real-session comparison — legacy URL is upgraded</li>
</ol>
<pre><code>"GET /cool/https%3A%2F%2Ffiles.example.org.uk%2F…%2Fwopi%2Ffiles%2F248470_…%2Fws?WOPISrc=…&amp;compat=/ws HTTP/1.1" 101 462685
</code></pre>
<p dir="auto">101 = successful WebSocket upgrade. The compact URL gives 400; the legacy URL gives 101 — seconds apart, same document.</p>
<ol start="4">
<li>Container nginx config</li>
</ol>
<p dir="auto">Active /etc/nginx/nginx.conf (port 8000 server) — the only upgrade location is the legacy regex:</p>
<pre><code># main websocket
location ~ ^/cool/(.*)/ws$ {
    proxy_pass http://localhost:9980;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 36000s;
}

# download, presentation and image upload
location ~ ^/(c|l)ool {
    proxy_pass http://localhost:9980;
    proxy_set_header Host $http_host;      # ← no upgrade headers, HTTP/1.0 default
}
</code></pre>
<p dir="auto"><code>/cool/ws</code> does not match <code>^/cool/(.*)/ws$</code> (that needs a segment between <code>/cool/</code> and <code>/ws</code>), so it falls through to <code>^/(c|l)ool</code> and is proxied without upgrade headers — exactly matching the <code>HTTP/1.0 … Connection: close</code> seen at coolwsd.</p>
<p dir="auto">Meanwhile <code>/etc/nginx/snippets/coolwsd.conf</code> does contain a correct compact-URL rule:</p>
<pre><code>location ^~ /cool/ {
    proxy_pass http://localhost:9980;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 36000s;
}
</code></pre>
<p dir="auto">…but it is not wired in. Proof:</p>
<ul>
<li>grep -rn 'snippets/coolwsd.conf' /etc/nginx/ returns nothing — no file includes it.</li>
<li>The snippet sets proxy_http_version 1.1; the live requests reach coolwsd as HTTP/1.0, which only the active config (without proxy_http_version) would produce.</li>
</ul>
<ol start="5">
<li>Curl tests (reproducible)</li>
</ol>
<pre><code># compact, container nginx → 400
curl -sS -o /dev/null -w '%{http_code}\n' -H 'Connection: Upgrade' -H 'Upgrade: websocket' \
  -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==' \
  'http://localhost:8000/cool/ws?WOPISrc=https%3A%2F%2Ffiles.example.org.uk%2F…%2Fwopi%2Ffiles%2F248470_…&amp;access_token=test'
# → 400

# compact, public URL (adds Cloudron host proxy + TLS) → 400
# → 400
</code></pre>
<p dir="auto">(<code>access_token=test</code> is a dummy, so status codes alone are not fully conclusive; the <code>coolwsd</code> log's <code>HTTP/1.0 vs WebSocket</code> distinction is the decisive evidence.)</p>
<h2>Root cause</h2>
<p dir="auto">Collabora 26.04 introduced a compact WebSocket URL /cool/ws?WOPISrc=…, replacing the older path-embedded form /cool/&lt;encoded-wopisrc&gt;/ws. Reverse proxies that only recognise the legacy form fail to upgrade the new URL. This is a documented upstream change requiring proxy-config updates:</p>
<ul>
<li>Upstream fix: Collabora Gerrit change 4102 — "Apache proxy: tunnel the compact /cool/ws WebSocket URL" (merged 2026-06-09), which adds ProxyPass /cool/ws ws://127.0.0.1:9980/cool/ws nocanon alongside the legacy rule: <a href="https://gerrit.collaboraoffice.com/c/online/+/4102" target="_blank" rel="noopener noreferrer nofollow ugc">https://gerrit.collaboraoffice.com/c/online/+/4102</a></li>
<li>Known issue: CollaboraOnline/online #15918 — "Websocket connection fails on Version 26 and newer" (Invalid or unknown request after upgrading to collabora/code:26.04.x): <a href="https://github.com/CollaboraOnline/online/issues/15918" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/CollaboraOnline/online/issues/15918</a></li>
<li>Proxy docs referenced by Collabora: <a href="https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html</a></li>
</ul>
<h2>Proposed fix (Cloudron app package)</h2>
<p dir="auto">Add an exact-match upgrade location for the compact URL to the active <code>/etc/nginx/nginx.conf</code> (port 8000 server), placed before the generic <code>location ~ ^/(c|l)ool</code>:</p>
<pre><code># Main websocket (compact URL — document passed via the WOPISrc query parameter)
location = /cool/ws {
    proxy_pass http://localhost:9980;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 36000s;
}
</code></pre>
<p dir="auto">…or wire in the already-shipped snippet by replacing the inline /browser, /hosting/<em>, /cool/</em>, /lool locations with include /etc/nginx/snippets/coolwsd.conf;. The exact (=) match takes priority and leaves the legacy regex working.</p>
<blockquote>
<p dir="auto">Caveat for Cloudron to check: the snippet uses proxy_set_header Host $host, while the active config uses $http_host. Confirm the Host header the WOPI/WebSocket path relies on remains correct after switching.</p>
</blockquote>
<p dir="auto">This is inside the app container image (/etc/nginx/…), so it can't be fixed persistently by an end user and would be overwritten on update — hence an app-package fix is required.</p>
<h2>Interim mitigations (end user)</h2>
<ul>
<li>None clean. The failure is masked by the client's fallback to the legacy URL, so most documents eventually open; there is no user-side setting to add the proxy rule.</li>
<li>If Cloudron can pin the Collabora app to a 25.04 build, that restores the pre-26.04 single WebSocket URL. (Confirm the option exists.)</li>
</ul>
<h2>Ruled out (from logs during failure windows)</h2>
<ul>
<li>Resources: Collabora memory limit 4 GB, ~1 GB used; CPU near idle; no correlated spikes.</li>
<li>WOPI allow-list / secret / DNS / host-alias: backend WOPI path completes cleanly with HTTP 200 (CheckFileInfo → GetFile → write-back) from COOLWSD HTTP Agent 26.04.4.2.</li>
<li>Deleted-user / orphaned-share errors (NoUserException … sima/jack): present earlier, resolved via occ sharing:delete-orphan-shares; unrelated.</li>
<li>HTTP/3 / CSP: not the trigger in the captured failures.</li>
</ul>
<h2>Secondary observations (not the cause)</h2>
<ul>
<li>Repeated Failed to exec coolmount … needs CAP_SYS_ADMIN … (known Cloudron jail-mount fallback; slower jail setup).</li>
<li>client intended to send too large body … POST /cool/convert-to/png → 413 (thumbnails).</li>
<li>Failed to fetch preset uri […/template/…] (template preload).</li>
</ul>
<h2>Attachments available on request</h2>
<p dir="auto">Browser console log, full coolwsd log, Nextcloud access log, and the container's nginx.conf / snippets/coolwsd.conf.</p>
]]></description><link>https://forum.cloudron.io/topic/16094/collabora-26.04-compact-websocket-url-cool-ws-is-not-proxied-as-a-websocket-upgrade-intermittent-document-loading-failed</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 13:49:43 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/16094.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Oct 2026 22:52:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Collabora 26.04: compact WebSocket URL /cool/ws is not proxied as a WebSocket upgrade → intermittent "Document loading failed" on Fri, 09 Oct 2026 08:05:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/da5nsy" aria-label="Profile: da5nsy">@<bdi>da5nsy</bdi></a></p>
<p dir="auto">An app update will be available soon that will fix this issue.</p>
]]></description><link>https://forum.cloudron.io/post/130716</link><guid isPermaLink="true">https://forum.cloudron.io/post/130716</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Fri, 09 Oct 2026 08:05:14 GMT</pubDate></item><item><title><![CDATA[Reply to Collabora 26.04: compact WebSocket URL /cool/ws is not proxied as a WebSocket upgrade → intermittent "Document loading failed" on Fri, 09 Oct 2026 06:47:43 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/da5nsy" aria-label="Profile: da5nsy">@<bdi>da5nsy</bdi></a></p>
<p dir="auto">Thanks for the report and for marking the topic as AI generated.<br />
I will look into it.</p>
]]></description><link>https://forum.cloudron.io/post/130714</link><guid isPermaLink="true">https://forum.cloudron.io/post/130714</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Fri, 09 Oct 2026 06:47:43 GMT</pubDate></item><item><title><![CDATA[Reply to Collabora 26.04: compact WebSocket URL /cool/ws is not proxied as a WebSocket upgrade → intermittent "Document loading failed" on Fri, 09 Oct 2026 00:08:25 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1791504501603-f17eb152-a6d9-4fbe-9f85-b67088ac4aa9-image.jpeg" alt="image.jpeg" class="img-markdown  img-fluid" width="652" height="568" /></p>
]]></description><link>https://forum.cloudron.io/post/130713</link><guid isPermaLink="true">https://forum.cloudron.io/post/130713</guid><dc:creator><![CDATA[da5nsy]]></dc:creator><pubDate>Fri, 09 Oct 2026 00:08:25 GMT</pubDate></item></channel></rss>