fix: wait for the document server before configuring its connector; 34.0.3:3 -> 34.0.3:4 - #141
Open
MattDHill wants to merge 1 commit into
Open
fix: wait for the document server before configuring its connector; 34.0.3:3 -> 34.0.3:4#141MattDHill wants to merge 1 commit into
MattDHill wants to merge 1 commit into
Conversation
…4.0.3:3 -> 34.0.3:4 Selecting a suite and starting Nextcloud before the document server was up left editing permanently broken. `richdocuments:activate-config` sets the WOPI url and then fetches discovery through this container's own proxy; when Collabora had bound its port but was not yet accepting connections the fetch returned 503, leaving the app holding a url with no discovery behind it. Every document then posted to the token endpoint, got a 500, and opened to a spinner that never resolved. The reconcile logged a warning and returned without recording its signature, which only schedules a retry on the next chain build — and nothing rebuilds the chain once the backend address has resolved, so it never retried. A bridge address is not a readiness signal: the port is bound, and the address therefore resolves, well before coolwsd accepts a connection. The oneshot now waits on the document server's own health check before it touches Nextcloud at all. That check fetches the endpoint this package depends on, so a pass means the work can succeed rather than merely that something is listening. The wait is a subscription, not a poll: it runs no commands, cannot fail, and releases the instant the service is ready, whether that is seconds later or whenever the user installs it. Nothing in the chain requires the oneshot, so a parked one holds nothing up. Past the gate every failure is unexpected, so none of them throw — a rejected oneshot fn is re-invoked on a widening backoff, which would run occ forever against a service that is simply not there. Switching suites now disables the connector it moves away from. richdocuments demotes the Microsoft formats whenever it finds a rival enabled, so every switch previously landed on a failing health check naming a step the package could take itself. It also enables the connector for the suite just selected, since occ refuses an app with no release compatible with the running major version and enforces that protection on its own. Both office services are declared in the manifest, so an uninstalled one is shown with its own title and icon rather than a bare package id, and the dependency result is typed against the manifest so a missing declaration is a compile error. The four Apache proxy modules move to `a2enmod` in the image; only the generated proxy config is still written at runtime. Health-check messages become whole sentences with a parameter rather than six concatenated fragments, and the check polls sparingly once settled while keeping the SDK default's fast first result and recovery. The ONLYOFFICE secret is read after the gate, because its install writes that file after its port is bound and a snapshot taken at chain build can be empty. Everywhere the docs still told users to install the connector app by hand is corrected; the package has done that since 34.0.3:3. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #139 and #140. Fixes a hang found on a production server, and closes the review findings on the office-suite work.
The hang
Selecting a suite and starting Nextcloud before the document server is up leaves editing permanently broken. From the reporting server's log:
richdocuments:activate-configsets the WOPI url and then fetches discovery back through this container's own proxy. Collabora had bound its port but was not yet accepting connections, so the fetch 503'd and left the app holding a url with no discovery behind it. Every document open then posted to/apps/richdocuments/token, got a 500, and showed a spinner that never resolved. Nothing was address-specific, so LAN and clearnet failed alike.It never recovered because the reconcile logged a warning and returned without recording its signature, which only schedules a retry on the next chain build — and once the backend address has resolved, nothing rebuilds the chain.
The fix
A bridge address is not a readiness signal. The port is bound, and the address therefore resolves, well before
coolwsdaccepts a connection. The oneshot now waits on the document server's own health check before touching Nextcloud at all:That check fetches the endpoint this package depends on, so a pass means the work can succeed rather than merely that something is listening. The wait is a subscription, not a poll: no commands, no failure mode, and it releases the instant the service is ready — whether that is seconds later or whenever the user gets around to installing it.
Past the gate every remaining failure is unexpected, so none of them throw. A oneshot whose fn rejects is re-invoked by the SDK on a widening backoff, which would run
occforever against a service that is simply not there.Also in this change
richdocumentsdemotes the Microsoft formats whenever it finds a rival enabled, so every switch previously landed on a failing health check naming a step the package could take itself.occrefuses an app with no release compatible with the running major version, so that protection is enforced without a check of our own.setupDependenciesis typed against the manifest so a missing declaration is a compile error.a2enmodin the image. Only the generated proxy config is still written at runtime.Verified on a dev box
startedtimestamp unchanged./hosting/discoverythrough the proxy returns 200 with everyurlsrcrewritten relative.Version goes to
34.0.3:4because:3reached beta. A switch to ONLYOFFICE is untested, since that package is not on the dev box.🤖 Generated with Claude Code