A file skipped while a backup is processed is reported as "unchanged" and its bytes as "backed up" #280

Closed
opened 2026-10-08 08:12:28 +02:00 by clawbot · 1 comment
Collaborator

Phase 1 of a backup counts every new or changed regular file into BytesScanned and FilesScanned (internal/snapshot/scanner.go:1043, :1057). Phase 2 may then fail to open the file. That happens under --skip-errors (scanner.go:1373-1383), or without the flag when the file is gone between the two phases (:1364-1370). The only adjustment made is FilesSkipped++. The file's size stays in BytesScanned, and the file reaches neither snapshot_files nor a blob.

The summary (internal/vaultik/snapshot.go:412-437) then prints the file as "unchanged" and its bytes as "backed up". The snapshots row gets a file_count and total_size that include it (:364-365). docs/DATAMODEL.md defines those columns as the number and size of the files in the snapshot.

Trigger: snapshot create --skip-errors over a directory holding one regular file that the process can lstat but not open, for example chmod 000 as a normal user. The output reads Files: 1 examined, 0 backed up, 1 unchanged and Data: S total (S backed up), contradicting the Failed to process error line printed above it.

Found by the third audit pass on next at c06c4d2, by code trace.

Definition of done

  1. A file that phase 2 could not store is in neither BytesScanned nor the "unchanged" count. The summary reports it as failed or skipped, and file_count and total_size exclude it.
  2. A test covers both cases, an unopenable file under --skip-errors and a file removed between the phases, and asserts the summary figures and the snapshots row.
  3. make check passes.

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

Phase 1 of a backup counts every new or changed regular file into `BytesScanned` and `FilesScanned` (`internal/snapshot/scanner.go:1043`, `:1057`). Phase 2 may then fail to open the file. That happens under `--skip-errors` (`scanner.go:1373-1383`), or without the flag when the file is gone between the two phases (`:1364-1370`). The only adjustment made is `FilesSkipped++`. The file's size stays in `BytesScanned`, and the file reaches neither `snapshot_files` nor a blob. The summary (`internal/vaultik/snapshot.go:412-437`) then prints the file as "unchanged" and its bytes as "backed up". The `snapshots` row gets a `file_count` and `total_size` that include it (`:364-365`). `docs/DATAMODEL.md` defines those columns as the number and size of the files in the snapshot. Trigger: `snapshot create --skip-errors` over a directory holding one regular file that the process can `lstat` but not `open`, for example `chmod 000` as a normal user. The output reads `Files: 1 examined, 0 backed up, 1 unchanged` and `Data: S total (S backed up)`, contradicting the `Failed to process` error line printed above it. Found by the third audit pass on `next` at `c06c4d2`, by code trace. ## Definition of done 1. A file that phase 2 could not store is in neither `BytesScanned` nor the "unchanged" count. The summary reports it as failed or skipped, and `file_count` and `total_size` exclude it. 2. A test covers both cases, an unopenable file under `--skip-errors` and a file removed between the phases, and asserts the summary figures and the `snapshots` row. 3. `make check` passes. Model: fable-5-1 (audit); opus-5-5 (issue)
clawbot self-assigned this 2026-10-08 08:12:28 +02:00
Author
Collaborator

Fixed in #282: a file that phase 2 cannot store is now counted as failed in the summary, and the data total, file_count and total_size leave it out.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/vaultik/pulls/282: a file that phase 2 cannot store is now counted as failed in the summary, and the data total, `file_count` and `total_size` leave it out. 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#280