prune and remote nuke exit 0 when a delete fails, and nuke still says the store is empty #290

Open
opened 2026-10-13 00:29:18 +02:00 by clawbot · 1 comment
Collaborator

Found by the defect hunt in #288 (part 4).

What is wrong: deleteUnreferencedBlobs (internal/vaultik/prune.go) logs each failed blob delete and counts it in BlobsFailed, but PruneBlobs still returns nil. removeAllLocalSnapshots and removeAllOrphanRemotes (internal/vaultik/snapshot.go) count failed metadata deletes and only warn. After either kind of failure, NukeRemote still prints "Backup destination store is now empty." The nuke warning also says "Run 'vaultik prune' once the remote is healthy", but prune never removes metadata (#251 fixed the same advice in snapshot remove).

How it was shown: with one blob's directory made read-only, prune --json printed "blobs_failed": 1 and exited 0. remote nuke --force printed "Failed to delete 1 blob(s)", then "Backup destination store is now empty.", exited 0, and left the blob. With one metadata directory read-only instead, nuke warned, printed "now empty", exited 0 and left four files.

Definition of done

  • prune (with and without --json, and the prune step of snapshot create --prune) exits non-zero when any blob delete fails; the --json document is still printed.
  • remote nuke exits non-zero when any delete fails, does not print that the store is empty, and its advice names a command that does remove what was left (running remote nuke again), not prune.
  • A successful remote nuke prints no prune advice either: today it reuses RemoveAllSnapshots, which prints "Note: Removed snapshots' blobs remain on the remote. Run 'vaultik prune' ..." before nuke deletes those blobs itself.
  • Tests cover a failed blob delete for prune and failed blob and metadata deletes for remote nuke.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 4). **What is wrong:** `deleteUnreferencedBlobs` (`internal/vaultik/prune.go`) logs each failed blob delete and counts it in `BlobsFailed`, but `PruneBlobs` still returns nil. `removeAllLocalSnapshots` and `removeAllOrphanRemotes` (`internal/vaultik/snapshot.go`) count failed metadata deletes and only warn. After either kind of failure, `NukeRemote` still prints "Backup destination store is now empty." The nuke warning also says "Run 'vaultik prune' once the remote is healthy", but `prune` never removes metadata (https://git.eeqj.de/sneak/vaultik/issues/251 fixed the same advice in `snapshot remove`). **How it was shown:** with one blob's directory made read-only, `prune --json` printed `"blobs_failed": 1` and exited 0. `remote nuke --force` printed "Failed to delete 1 blob(s)", then "Backup destination store is now empty.", exited 0, and left the blob. With one metadata directory read-only instead, nuke warned, printed "now empty", exited 0 and left four files. **Definition of done** - `prune` (with and without `--json`, and the prune step of `snapshot create --prune`) exits non-zero when any blob delete fails; the `--json` document is still printed. - `remote nuke` exits non-zero when any delete fails, does not print that the store is empty, and its advice names a command that does remove what was left (running `remote nuke` again), not `prune`. - A successful `remote nuke` prints no `prune` advice either: today it reuses `RemoveAllSnapshots`, which prints "Note: Removed snapshots' blobs remain on the remote. Run 'vaultik prune' ..." before nuke deletes those blobs itself. - Tests cover a failed blob delete for `prune` and failed blob and metadata deletes for `remote nuke`. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:29:18 +02:00
Author
Collaborator

Built in #336: prune (also under --json and snapshot create --prune) and remote nuke now exit non-zero when a delete fails. Nuke no longer reports the store empty on failure, says to run vaultik remote nuke --force again, and no longer advises prune after a successful run.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/vaultik/pulls/336: `prune` (also under `--json` and `snapshot create --prune`) and `remote nuke` now exit non-zero when a delete fails. Nuke no longer reports the store empty on failure, says to run `vaultik remote nuke --force` again, and no longer advises `prune` after a successful run. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#290