Under --skip-errors, a local index error while recording a directory or symlink is skipped instead of stopping the backup #284

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

processFileWithErrorHandling (internal/snapshot/scanner.go:1352-1389) aborts on a packer error and skips everything else under --skip-errors. Its own comment says "Only open and read errors are skipped below". A directory or symlink has no data to open, though: phase 2 only records it in the local index. A database error while recording one is therefore not an open or read error, yet it is skipped like one. The snapshot then completes without that entry, and a restore does not recreate the directory with its stored owner, mode and times, or does not recreate the symlink at all.

The README limits --skip-errors to files that cannot be read, and says errors that would leave the snapshot's records wrong still stop the run.

Reported by the worker on #280 and confirmed in the code on next at 79a73fa.

Definition of done

  1. Under --skip-errors, only errors from opening or reading a file are skipped. A local index error while recording any entry stops the backup, as it does without the flag, and the code comment says so truthfully.
  2. A test injects a database error while a directory is recorded, runs with --skip-errors, and asserts that the backup fails and the snapshot is not recorded as complete.
  3. make check passes.

Model: opus-5-5

`processFileWithErrorHandling` (`internal/snapshot/scanner.go:1352-1389`) aborts on a packer error and skips everything else under `--skip-errors`. Its own comment says "Only open and read errors are skipped below". A directory or symlink has no data to open, though: phase 2 only records it in the local index. A database error while recording one is therefore not an open or read error, yet it is skipped like one. The snapshot then completes without that entry, and a restore does not recreate the directory with its stored owner, mode and times, or does not recreate the symlink at all. The README limits `--skip-errors` to files that cannot be read, and says errors that would leave the snapshot's records wrong still stop the run. Reported by the worker on https://git.eeqj.de/sneak/vaultik/issues/280 and confirmed in the code on `next` at `79a73fa`. ## Definition of done 1. Under `--skip-errors`, only errors from opening or reading a file are skipped. A local index error while recording any entry stops the backup, as it does without the flag, and the code comment says so truthfully. 2. A test injects a database error while a directory is recorded, runs with `--skip-errors`, and asserts that the backup fails and the snapshot is not recorded as complete. 3. `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-08 10:12:36 +02:00
Author
Collaborator

Confirmed on next at 79a73fa with a failing test. Fixed in #285: a directory or symlink is now recorded before the --skip-errors handling, so an error recording it in the local index stops the backup.

Model: opus-5-5

Confirmed on `next` at `79a73fa` with a failing test. Fixed in https://git.eeqj.de/sneak/vaultik/pulls/285: a directory or symlink is now recorded before the `--skip-errors` handling, so an error recording it in the local index stops the backup. 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#284