Repository navigation
Conversation
Migration only runs forward, so an older dashmate reads a config.json a newer one has already stamped without migrating it, and its in-memory copy keeps the newer stamp. Saving it then writes the older build's state under that stamp, and every save is followed by rendering all service files from the older templates. The newer build never migrates the file again. The usual trigger is the dashmate-helper container: its image is pinned to the CLI that started it, so after a manual CLI upgrade without a restart its certificate renewal does exactly this. ConfigFileJsonRepository now refuses, under the lock, any write over a file whose configFormatVersion is newer than the format this build produces: - in #save, the one point every write path goes through; - in acquire(), so a renewal or a lock-holding command stops before its long work (no certificate issuance is spent first) and the lock is released; - in update(), before reading, so the refusal is not hidden behind a schema error for a newer shape. readAndMigrate() treats a newer file as read-only: the unlocked probe no longer reports a stock-seed refresh as due, and the locked re-read returns without rendering when a newer build migrated the file while this one waited for the lock. Reads are otherwise unchanged, so an older build can still report. A missing file, an unreadable one or a stamp that is not semver is left to the existing read path. The helper's renewal loop already catches the error, logs it and retries in an hour, so it neither crashes nor spins. Tests would have caught this: 12 failing on the unfixed repository (older write/update/acquire accepted, seed refresh rendered, the race rendered, prerelease order cases, helper renewal went on to issuance), 63 passing after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…is outdated A dashmate helper older than the dashmate that last saved config.json now refuses to renew rather than overwrite the newer settings. Its renewal record classified that refusal as UNKNOWN, so doctor said dashmate could not work out why, sent the operator to support and withheld `ssl obtain`. The cause is known and a restart fixes it. A refusal made when the renewal takes the lock, before it does any work, is now recorded as HELPER_OUTDATED with a RESTART_NODE remedy. The same error met at a later save can only follow a lock taken over mid-renewal, when a certificate may already have been issued, so it is recorded as RESULT_UNKNOWN and keeps the request withheld. - doctor tells the operator to restart the node with the dashmate that last updated its configuration (or start it if it is stopped) and says renewal resumes by itself; it names that dashmate rather than "this version" because the dashmate reading the record may itself be the outdated one; - with a broken certificate doctor gives the obtain command first and the restart after it, because a restart makes the gateway reload whatever pair is on disk; - while an earlier attempt's issuance marker withholds the request, the restart is still given, conditional on the certificate files on disk working: an outdated helper never succeeds, so the marker would otherwise hide the only fix for good; - the update command's certificate guidance adds the restart after its existing repair, and leaves it out for a stopped node, which it already tells to start; - safe-action derivation treats it like WAIT: wait for the fix while the certificate works, obtain after it once it does not. The record is written by the helper and read by the CLI, and both get the code in this release, so a helper that can refuse always has a reader that knows the code. Tests would have caught this: 11 failing before (classifier gave UNKNOWN, doctor and update gave no restart, derivation sent the operator to support, no refusal was marked as made before any work), 263 passing in the touched specs after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he helper A host or Docker restart brings the dashmate-helper container back with the image it was created from, which can be older than the CLI that has since saved config.json. Its certificate renewal then refuses to save over the newer config, but only says so when a certificate is due, which can be days later. On a node that renews certificates (SSL enabled with ZeroSSL or Let's Encrypt), the helper now logs one warning at startup naming both config formats and the restart command for its config. No test: scripts/helper.js is the container entry point and has no unit harness, and the change only logs. The refusal it warns about is covered by the repository and renewCertificate tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 8b8e186 ("fix(dashmate): tell doctor and update to restart a node whose helper is outdated"). Advising a restart safely for an outdated helper needs more than this PR provides: a way to replace only the helper without reloading the gateway, detection of the running helper's version independently of the renewal record, and node-wide state in the update guidance. That work moves to a follow-up PR. Until then, a renewal refused by an outdated helper is recorded as UNKNOWN again. Doctor names no cause for it, withholds `ssl obtain` and points to support, and prints no restart command. The refusal itself, and the reason for it, stay in the helper's log. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a restart The refusal message and the helper's startup warning told the operator to run `dashmate restart`. A restart reloads the gateway from the certificate files on disk, and nothing on these paths has checked that those files form a working pair with a complete chain, so following the advice could take a gateway that still serves a good certificate from memory offline. Both messages now only state what happened: the two config formats, that nothing was saved, that the helper runs the version that started the node, and that downgrading is unsupported. The refusal still names the newer dashmate and how to find every copy on PATH. Safe recovery advice for an outdated helper is designed in a follow-up PR. Test: the refusal-message test now asserts no restart is advised; it fails against the previous message and passes with this one. The helper warning has no unit harness and only logs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An older dashmate reading a config a newer one migrated may not save it, but #buildConfigFile still swapped in its own replacement for stock seeds it considered obsolete. `config get --raw` and every other reader of the stored options then reported seeds the file does not hold. Seed substitution is skipped when the file records a newer format than this build produces, so an older build reports the file as saved. Test would have caught this: the older-build seed tests now assert the stored seeds and a clean read; both (mainnet, testnet) fail before the fix and pass after. Full dashmate unit suite: 1189 passing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… seed refresh for older files The helper test now asserts that a renewal refused by an outdated helper is classified UNKNOWN, so restoring a cause, and with it a prescribed repair, fails a test until a safe one exists. The seed refresh skip is for files a newer build owns. New positive cases keep the refresh for an older stamp, a stamp that is not semver, and a repository with no format version of its own. Test-only change; no behaviour changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…is outdated A dashmate helper older than the dashmate that last saved config.json now refuses to renew rather than overwrite the newer settings. Its renewal record classified that refusal as UNKNOWN, so doctor said dashmate could not work out why, sent the operator to support and withheld `ssl obtain`. The cause is known and a restart fixes it. A refusal made when the renewal takes the lock, before it does any work, is now recorded as HELPER_OUTDATED with a RESTART_NODE remedy. The same error met at a later save can only follow a lock taken over mid-renewal, when a certificate may already have been issued, so it is recorded as RESULT_UNKNOWN and keeps the request withheld. - doctor tells the operator to restart the node with the dashmate that last updated its configuration (or start it if it is stopped) and says renewal resumes by itself; it names that dashmate rather than "this version" because the dashmate reading the record may itself be the outdated one; - with a broken certificate doctor gives the obtain command first and the restart after it, because a restart makes the gateway reload whatever pair is on disk; - while an earlier attempt's issuance marker withholds the request, the restart is still given, conditional on the certificate files on disk working: an outdated helper never succeeds, so the marker would otherwise hide the only fix for good; - the update command's certificate guidance adds the restart after its existing repair, and leaves it out for a stopped node, which it already tells to start; - safe-action derivation treats it like WAIT: wait for the fix while the certificate works, obtain after it once it does not. The record is written by the helper and read by the CLI, and both get the code in this release, so a helper that can refuse always has a reader that knows the code. Tests would have caught this: 11 failing before (classifier gave UNKNOWN, doctor and update gave no restart, derivation sent the operator to support, no refusal was marked as made before any work), 263 passing in the touched specs after. Re-applied from 8b8e186, which #6301 reverts so the advice can be finished here. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fied disk pair With a working installed certificate and a HELPER_OUTDATED renewal record, doctor told the operator to restart the node. A restart makes the gateway load the pair on disk. When the gateway is serving a different pair and the one on disk is not a verified replacement, the same report already says not to restart to load it, so the two problems contradicted each other and the restart could take a working gateway onto an unverified pair. The disk-pair verdict the served-certificate branch uses is now one function, and the helper restart is conditional on the certificate files on disk working whenever the served sample shows such a pair. A gateway serving the pair on disk keeps the direct restart. Test would have caught this: the new doctor test fails before the fix (direct restart next to "do not restart") and passes after; the positive control pins the direct restart when served and disk match. Full dashmate unit suite: 1201 passing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
6 of 13 tasks
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit 07efd4a. Normal review starts when eligible; priority review starts as soon as a slot is available. |
…d without prescribing a repair A renewal refused by a helper older than the config was recorded as UNKNOWN, so doctor said dashmate could not work out why, although the helper knew. It is now recorded as HELPER_OUTDATED with a factual sentence and the existing SUPPORT remedy. Doctor and update name the cause, keep withholding `ssl obtain` and point to support, exactly as before; neither prints a restart. Recovery advice for this cause is designed separately. Tests would have caught this: 4 failing before (classifier gave UNKNOWN; doctor said "could not work out why" for a working and an expired certificate), passing after, with doctor asserted to print neither `ssl obtain` nor `dashmate restart`. Full dashmate unit suite: 1195 passing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#6301 now records an outdated helper's refusal as HELPER_OUTDATED with the SUPPORT remedy. This branch already defines HELPER_OUTDATED with the RESTART_NODE remedy, classifies it only for a refusal made before any work, and tests doctor's restart advice, so this branch's versions of the four files that commit touches are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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.
Issue being fixed or feature implemented
Paused. This needs a design for certificate guidance with an outdated dashmate helper before it can be finished.
Since #6301, a dashmate helper older than the dashmate that last saved
config.jsonrefuses to renew certificates rather than overwrite the newer config. #6301 records that refusal without a cause, so doctor names no cause and prints no repair. This PR carries the guidance that was split out of #6301: a dedicatedHELPER_OUTDATEDrenewal failure code, plus doctor andupdateadvice for recovering from it.That advice currently tells the operator to restart the node. Review found cases where the restart is unsafe or cannot finish (listed below). Fixing them needs:
updateguidance.Stacked on #6301 (base branch
dashmate-newer-config-guard).What was done?
Re-applies two commits:
c1afc945f0(re-applied from8b8e186987, which fix(dashmate): refuse to overwrite a config a newer dashmate migrated #6301 reverts): theHELPER_OUTDATEDcode with aRESTART_NODEremedy, plus doctor andupdateendings that tell the operator to restart the node.f529900e7d(from069f90f6e7): doctor makes that restart conditional when the served sample shows a different disk pair that is not a verified replacement.Requirements before this can be finished
These are the open review findings from #6301:
updatehides the outdated helper. Installing a certificate removes the renewal record, so neitherupdatenor doctor still reports that the running helper will refuse the next renewal.updatealso returns without reading the record when the certificate passes. The outdated helper needs reporting separately from certificate state, including after a manual repair.updatedecides "node running" from the gateway alone. Plaindashmate startis refused while Core runs, andssl obtaindoes not reload a stopped gateway. The recovery command has to come from node-wide Compose state and follow the certificate repair.ssl obtain,config set). It should state first that the commands must run with the newer dashmate.f529900e7dcovers the leaf-mismatch case. Requirement 1 covers the case this does not reach.How Has This Been Tested?
The full dashmate unit suite (
yarn mocha --recursive test/unit) passes on this branch: 1204 passing. Nothing beyond the re-applied commits' own tests has been added for the requirements above.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull request (not applicable)For repository code-owners and collaborators only
🤖 Generated with Claude Code
Deferred from #6301
updateshows the recorded newer-config refusal next to the possible-issuance warning while the installed certificate still works, and points to the localdashmate doctorcheck (thread).readAndMigrate()save) is not recorded as possible issuance; an issuance marker from an earlier attempt is kept (thread).