Report blobs shallow verify could not check apart from missing ones #348

Open
clawbot wants to merge 1 commits from issue-318-verify-stat-errors into next
Collaborator

Fixes #318.

What was wrong: shallow snapshot verify counted every error from checking a blob or the encrypted database as "missing": a permission error, an S3 403 or a network error read as data loss, and the real error was printed nowhere.

What changed: only a not-found answer from storage counts as missing. Any other error is reported as could not be checked, with the error storage returned, and the run fails:

  • text report: a Could not check: line per blob naming the hash and the error, a count in the summary, and an Encrypted database: could not be checked line carrying the error;
  • --json: an unchecked list of hash and error pairs, and a database_check_error field;
  • --quiet (and --cron), which drop the report: each of those errors is logged as a warning on stderr, alongside the failure the command ends with.

The database check moved into its own small function, checkSnapshotDatabase, because VerifySnapshotWithOptions was at the linter's function-length limit.

The new --quiet test is not parallel: it captures the process's stderr, as the snapshot list stderr tests do.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/318. **What was wrong:** shallow `snapshot verify` counted every error from checking a blob or the encrypted database as "missing": a permission error, an S3 403 or a network error read as data loss, and the real error was printed nowhere. **What changed:** only a not-found answer from storage counts as missing. Any other error is reported as could not be checked, with the error storage returned, and the run fails: - text report: a `Could not check:` line per blob naming the hash and the error, a count in the summary, and an `Encrypted database: could not be checked` line carrying the error; - `--json`: an `unchecked` list of `hash` and `error` pairs, and a `database_check_error` field; - `--quiet` (and `--cron`), which drop the report: each of those errors is logged as a warning on stderr, alongside the failure the command ends with. The database check moved into its own small function, `checkSnapshotDatabase`, because `VerifySnapshotWithOptions` was at the linter's function-length limit. The new `--quiet` test is not parallel: it captures the process's stderr, as the `snapshot list` stderr tests do. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 10:47:45 +02:00
clawbot self-assigned this 2026-10-13 10:47:45 +02:00
Author
Collaborator
  1. Under --quiet the storage error is still printed nowhere (internal/vaultik/snapshot.go, verifyManifestBlobs, formatVerifyResult, shallowVerifyFailure). The Could not check lines and the summary are skipped, and the failure the command ends with says only "N blobs could not be checked" or "the encrypted database could not be checked". That is the defect #318 reports, left in place for quiet runs, where a transient error is lost for good; the README says --quiet suppresses only non-error output. Acceptable: under --quiet the error storage returned, for each blob and for the database, still reaches stderr.

  2. The new test does not pin that a blob or database that could not be checked fails the run (internal/vaultik/shallow_verify_test.go, TestShallowVerifyReportsStatErrorsApartFromMissing). It always deletes a blob in the same run, so verify fails whatever else happens; the test would still pass if those two cases stopped failing the run, and a snapshot whose only problem is a blob storage could not check would then verify as OK. Acceptable: a run whose only problem is a blob that could not be checked, and one whose only problem is the database, each asserting that verify fails.

Model: opus-5-5

1. Under `--quiet` the storage error is still printed nowhere (`internal/vaultik/snapshot.go`, `verifyManifestBlobs`, `formatVerifyResult`, `shallowVerifyFailure`). The `Could not check` lines and the summary are skipped, and the failure the command ends with says only "N blobs could not be checked" or "the encrypted database could not be checked". That is the defect https://git.eeqj.de/sneak/vaultik/issues/318 reports, left in place for quiet runs, where a transient error is lost for good; the README says `--quiet` suppresses only non-error output. Acceptable: under `--quiet` the error storage returned, for each blob and for the database, still reaches stderr. 2. The new test does not pin that a blob or database that could not be checked fails the run (`internal/vaultik/shallow_verify_test.go`, `TestShallowVerifyReportsStatErrorsApartFromMissing`). It always deletes a blob in the same run, so verify fails whatever else happens; the test would still pass if those two cases stopped failing the run, and a snapshot whose only problem is a blob storage could not check would then verify as OK. Acceptable: a run whose only problem is a blob that could not be checked, and one whose only problem is the database, each asserting that verify fails. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-13 11:20:33 +02:00
clawbot force-pushed issue-318-verify-stat-errors from bf8bf5f49c to 8b68432005 2026-10-13 11:27:06 +02:00 Compare
clawbot force-pushed issue-318-verify-stat-errors from 8b68432005 to 670c5703be 2026-10-13 13:35:52 +02:00 Compare
clawbot force-pushed issue-318-verify-stat-errors from 670c5703be to 3dbe430659 2026-10-13 14:43:22 +02:00 Compare
clawbot added 1 commit 2026-10-13 16:53:02 +02:00
Shallow snapshot verify counted every error from checking a blob or the
encrypted database as "missing" and printed the error nowhere, so a
permission error or an S3 403 read as data loss. Now only a not-found
answer from storage counts as missing. Any other error is reported as
could not be checked, with the error storage returned, in the text
report and under --json (the new unchecked list and
database_check_error field), and the run fails. Under --quiet, which
drops the report, each of those errors is logged as a warning on
stderr.

The database check moved into its own small function because the verify
function was at the linter's length limit.

Model: opus-5-5
clawbot force-pushed issue-318-verify-stat-errors from 3dbe430659 to 8a8793c2c0 2026-10-13 16:53:02 +02:00 Compare
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-318-verify-stat-errors:issue-318-verify-stat-errors
git checkout issue-318-verify-stat-errors
Sign in to join this conversation.