cosmetic: a failed command prints its error twice on stderr #433

Closed
opened 2026-11-11 01:02:05 +01:00 by clawbot · 2 comments
Collaborator

Found by the acceptance test (#418).

Steps to reproduce

  • Run any command that fails after startup, for example vaultik snapshot create with a configured path that does not exist.

What happened

stderr carries the same error twice: once as a log record (a JSON object when piped, a coloured line on a terminal) and once as the final ERROR: line. Example, piped:

  • {"time":"...","level":"ERROR","msg":"Snapshot creation failed","error":"failed to scan /home/user/no-such-dir: ...","caller":"snapshot.go:127"}
  • ERROR: Snapshot creation failed: failed to scan /home/user/no-such-dir: ...

On a terminal the user reads the same sentence twice, the second time without colour.

What should happen

One of the two. The final ERROR: line is the one the README documents; the log record adds nothing a user needs unless --verbose or --debug is on.

Model: fable-5-1

Found by the acceptance test (https://git.eeqj.de/sneak/vaultik/issues/418). **Steps to reproduce** - Run any command that fails after startup, for example `vaultik snapshot create` with a configured path that does not exist. **What happened** stderr carries the same error twice: once as a log record (a JSON object when piped, a coloured line on a terminal) and once as the final `ERROR:` line. Example, piped: - `{"time":"...","level":"ERROR","msg":"Snapshot creation failed","error":"failed to scan /home/user/no-such-dir: ...","caller":"snapshot.go:127"}` - `ERROR: Snapshot creation failed: failed to scan /home/user/no-such-dir: ...` On a terminal the user reads the same sentence twice, the second time without colour. **What should happen** One of the two. The final `ERROR:` line is the one the README documents; the log record adds nothing a user needs unless `--verbose` or `--debug` is on. Model: fable-5-1
Author
Collaborator

Plan: a failed command prints its error once on stderr, as the final ERROR: line the README documents. The log record of that same error is written only under --verbose or --debug.

Package: internal/cli (app.go, where the final error is printed).

For every unit from the acceptance test

  • One branch off current next, one PR with base next, labelled needs-review and assigned to clawbot. The title ends (closes #N).
  • Add nothing to docs/TODO.md. sneak ruled on 11 November that it is not a history document (#440).
  • README.md on next: change only a sentence the fix makes false. The rewritten README in #399 is with sneak and is updated after this merges.
  • A test that fails on current next shows the fix. Run make fmt and make check before the final push.

Model: opus-5-5

Plan: a failed command prints its error once on stderr, as the final `ERROR:` line the README documents. The log record of that same error is written only under `--verbose` or `--debug`. Package: `internal/cli` (`app.go`, where the final error is printed). **For every unit from the acceptance test** - One branch off current `next`, one PR with base `next`, labelled `needs-review` and assigned to `clawbot`. The title ends `(closes #N)`. - Add nothing to `docs/TODO.md`. sneak ruled on 11 November that it is not a history document (https://git.eeqj.de/sneak/vaultik/issues/440). - `README.md` on `next`: change only a sentence the fix makes false. The rewritten README in https://git.eeqj.de/sneak/vaultik/pulls/399 is with sneak and is updated after this merges. - A test that fails on current `next` shows the fix. Run `make fmt` and `make check` before the final push. Model: opus-5-5
clawbot self-assigned this 2026-11-11 01:21:31 +01:00
Author
Collaborator

Built in #451: the failure handlers in internal/cli log the failure at info level, so the ERROR: line is the only report unless --verbose or --debug is on.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/vaultik/pulls/451: the failure handlers in `internal/cli` log the failure at info level, so the `ERROR:` line is the only report unless `--verbose` or `--debug` is on. 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#433