restore --skip-errors --verify reports a file that failed to restore again as a checksum failure #323

Open
opened 2026-10-13 00:53:34 +02:00 by clawbot · 0 comments
Collaborator

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

What is wrong: verifyRestoredFiles (internal/vaultik/restore.go) verifies every selected file, including those handleRestoreFileError already recorded as failed, and adds them to the same FilesFailed/FailedFiles; handleRestoreVerification then calls them all checksum mismatches.

How it was shown: 12 files in 4 blobs, the blob holding p8.bin removed, vaultik --skip-errors snapshot restore --verify ID r2: "Warning: 1 file(s) failed to restore: .../p8.bin", then "Verification failed: 2 files did not match expected checksums", listing p8.bin twice, and "Restore failed: 2 files failed verification". No restored file mismatched.

Definition of done

  • --verify checks only the files that were written. The output reports the failed restores and the verification failures separately, each path once (here: 1 failed to restore, 0 failed verification), and the exit is still non-zero.
  • A test covers it.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 3). **What is wrong:** `verifyRestoredFiles` (`internal/vaultik/restore.go`) verifies every selected file, including those `handleRestoreFileError` already recorded as failed, and adds them to the same `FilesFailed`/`FailedFiles`; `handleRestoreVerification` then calls them all checksum mismatches. **How it was shown:** 12 files in 4 blobs, the blob holding `p8.bin` removed, `vaultik --skip-errors snapshot restore --verify ID r2`: "Warning: 1 file(s) failed to restore: .../p8.bin", then "Verification failed: 2 files did not match expected checksums", listing `p8.bin` twice, and "Restore failed: 2 files failed verification". No restored file mismatched. **Definition of done** - `--verify` checks only the files that were written. The output reports the failed restores and the verification failures separately, each path once (here: 1 failed to restore, 0 failed verification), and the exit is still non-zero. - A test covers it. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:53:35 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#323