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-toolsmerged 2 commits from fix/1585-dump-stderr into main2026-11-04 11:06:34 +00:00
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
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
Deliverynovox/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`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.
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).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 1is noted on the issue.Test budget: modules/nats 29 tests (6 integration), modules/restic 53.
Reviewed-by: review-restic-stderr@shanks at
4aa77a4237https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
Delivery
novox/mesh-catalog@4aa77a4237dd— merged since 2026-11-04T11:06:35ZSource — source.main moved to novox/mesh-catalog@7fe569ef40. Whether it reached the machines is
mesh-delivery-view's, derived fromsource.main, the wants and the haves.Transitions
The commit's note under
refs/notes/mesh-plankeeps every transition of this change up to its merge:git log --notes=mesh-plan.