A failed backup names its cause: nats's dump keeps the snapshot's exit status and the container's state, restic reports the tail of what a command printed (issue 1585) #608

Merged
mesh-tools merged 2 commits from fix/1585-dump-stderr into main 2026-11-04 11:06:34 +00:00
Member

Issue 1585 note 50: the backup before a nats move failed three times with only "the backup failed: sh: exit status 1", and a hand backup two minutes later succeeded, so its cause was unreadable.

  • modules/nats: backup.dump keeps the real status of docker exec ... mesh-nats-snapshot snapshot; on failure it says "mesh-nats-snapshot snapshot exited N" ("(killed by a signal)" for 137/143) and the container's state and start time on stderr, removes the partial archive and exits N. Before, || { rm; exit 1; } turned every failure, a kill included, into a silent exit 1. Test: dump_test.go runs the real manifest's dump under sh with a fake docker (137 and 3).
  • modules/restic: a failed command reports its name, its exit status and the last 2 KB of stderr (stdout when stderr is empty), cut on a character boundary, with password, secret, token and api-key values blotted (key=value, key: value and JSON forms); "(it printed nothing)" when it printed nothing. One table test.

Quick fix: a backup by hand to read the error; it tells nothing, the hand backup succeeds. Thorough fix, chosen: the dump and the module that runs every dump say their own status, so the next failure of any module's backup names its cause. Only nats's dump had the masking pattern; postgres's inner || exit 1 is noted on the issue.

Test budget: modules/nats 29 tests (6 integration), modules/restic 53.

Reviewed-by: review-restic-stderr@shanks at 4aa77a4237

https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn

Issue 1585 note 50: the backup before a nats move failed three times with only "the backup failed: sh: exit status 1", and a hand backup two minutes later succeeded, so its cause was unreadable. - modules/nats: backup.dump keeps the real status of `docker exec ... mesh-nats-snapshot snapshot`; on failure it says "mesh-nats-snapshot snapshot exited N" ("(killed by a signal)" for 137/143) and the container's state and start time on stderr, removes the partial archive and exits N. Before, `|| { rm; exit 1; }` turned every failure, a kill included, into a silent exit 1. Test: dump_test.go runs the real manifest's dump under sh with a fake docker (137 and 3). - modules/restic: a failed command reports its name, its exit status and the last 2 KB of stderr (stdout when stderr is empty), cut on a character boundary, with password, secret, token and api-key values blotted (key=value, key: value and JSON forms); "(it printed nothing)" when it printed nothing. One table test. Quick fix: a backup by hand to read the error; it tells nothing, the hand backup succeeds. Thorough fix, chosen: the dump and the module that runs every dump say their own status, so the next failure of any module's backup names its cause. Only nats's dump had the masking pattern; postgres's inner `|| exit 1` is noted on the issue. Test budget: modules/nats 29 tests (6 integration), modules/restic 53. Reviewed-by: review-restic-stderr@shanks at 4aa77a4237ddac724018b03b2b31b101732d7342 https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
mesh-tools added 2 commits 2026-11-04 10:52:48 +00:00
Issue 1585: the backup before a nats move failed with only 'sh: exit status 1'.

Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
nats dump keeps and says the snapshot's exit status; restic blots JSON credentials and cuts on a character
mesh/delivery merged: source.main moved to novox/mesh-catalog@7fe569ef4067
mesh/check being carried to 4aa77a4237dd on 7fe569ef4067 | from 7f626147be0c
4aa77a4237
Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
Author
Member

Delivery novox/mesh-catalog@4aa77a4237dd — merged since 2026-11-04T11:06:35Z

Source — source.main moved to novox/mesh-catalog@7fe569ef40. Whether it reached the machines is mesh-delivery-view's, derived from source.main, the wants and the haves.

Transitions

  • 2026-11-04 10:52 (new) → proposed (announced): novox/mesh-catalog#608's head announced
  • 2026-11-04 10:52 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false)
  • 2026-11-04 11:06 ready → merged (merged): on the trunk its modules follow: merged there

The commit's note under refs/notes/mesh-plan keeps every transition of this change up to its merge: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-catalog@4aa77a4237dd` — **merged** since 2026-11-04T11:06:35Z **Source** — source.main moved to novox/mesh-catalog@7fe569ef4067. Whether it reached the machines is `mesh-delivery-view`'s, derived from `source.main`, the wants and the haves. **Transitions** - 2026-11-04 10:52 (new) → proposed (announced): novox/mesh-catalog#608's head announced - 2026-11-04 10:52 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false) - 2026-11-04 11:06 ready → merged (merged): on the trunk its modules follow: merged there The commit's note under `refs/notes/mesh-plan` keeps every transition of this change up to its merge: `git log --notes=mesh-plan`.
mesh-tools merged commit 7fe569ef40 into main 2026-11-04 11:06:34 +00:00
mesh-tools deleted branch fix/1585-dump-stderr 2026-11-04 11:06:34 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#608