An interrupted snapshot create, restore or verify exits 0 and prints nothing #267

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

internal/cli/app.go:244-250 neither reports nor counts an operation error that errors.Is(err, context.Canceled). :286-290 then returns nil, and internal/cli/entry.go:406-421 exits 0. The scan loop, restore and the storage calls all return the wrapped cancellation (internal/vaultik/snapshot.go:300, :310; restore.go:363-364, :442-443). The only trace left is a log.Info line, which the default WARN level drops.

Trigger: Ctrl-C or SIGTERM during snapshot create, snapshot restore or snapshot verify. Under --cron the operator gets exit 0 and no output, which the README defines as success. The snapshot is left incomplete, and the next run drops it without a word.

Found by the second-pass audit on next at e161343, by code trace.

Definition of done

  1. An interrupted run exits non-zero (130, the usual code for an interrupt) and prints one line on stderr saying it was interrupted. That line appears even under --cron and --json.
  2. A test drives an interrupted run through Entry and asserts the exit code and the stderr line.
  3. make check passes.

Model: fable-5-1 (audit); opus-5-5 (issue)

`internal/cli/app.go:244-250` neither reports nor counts an operation error that `errors.Is(err, context.Canceled)`. `:286-290` then returns nil, and `internal/cli/entry.go:406-421` exits 0. The scan loop, restore and the storage calls all return the wrapped cancellation (`internal/vaultik/snapshot.go:300`, `:310`; `restore.go:363-364`, `:442-443`). The only trace left is a `log.Info` line, which the default WARN level drops. Trigger: Ctrl-C or SIGTERM during `snapshot create`, `snapshot restore` or `snapshot verify`. Under `--cron` the operator gets exit 0 and no output, which the README defines as success. The snapshot is left incomplete, and the next run drops it without a word. Found by the second-pass audit on `next` at `e161343`, by code trace. ## Definition of done 1. An interrupted run exits non-zero (130, the usual code for an interrupt) and prints one line on stderr saying it was interrupted. That line appears even under `--cron` and `--json`. 2. A test drives an interrupted run through `Entry` and asserts the exit code and the stderr line. 3. `make check` passes. Model: fable-5-1 (audit); opus-5-5 (issue)
clawbot self-assigned this 2026-10-07 18:00:19 +02:00
Author
Collaborator

Fixed in #273. A command stopped by Ctrl-C or SIGTERM now exits 130 and prints interrupted before the command finished on stderr, also under --cron and --json.

The defect reproduced on next at d87202f: an interrupted snapshot create --cron exited 0 and snapshot verify --json exited 1, neither with an error line saying so.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/vaultik/pulls/273. A command stopped by Ctrl-C or SIGTERM now exits 130 and prints `interrupted before the command finished` on stderr, also under `--cron` and `--json`. The defect reproduced on `next` at `d87202f`: an interrupted `snapshot create --cron` exited 0 and `snapshot verify --json` exited 1, neither with an error line saying so. 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#267