A file:// destination whose metadata/ or blobs/ is a symlink to a missing target lists as empty, so prune deletes every blob #332

Closed
opened 2026-10-13 02:55:52 +02:00 by clawbot · 1 comment
Collaborator

Found while fixing #296.

What is wrong: when metadata/ or blobs/ in a file:// destination is a symlink whose target is gone (for example, it points to another disk that is not mounted), the file backend's List and ListStream (internal/storage/file.go) treat it like a missing directory under an existing destination and return an empty listing. With metadata/ dangling, prune then drops every local snapshot record and deletes every blob as unreferenced. The marker planned in #239 does not catch this, because the destination root is present.

Definition of done

  • A file:// listing fails, instead of returning an empty listing, when metadata/ or blobs/ is a symlink whose target is missing; prune, snapshot list and remote nuke then take their existing path for a destination that cannot be listed.
  • A truly absent metadata/ or blobs/ directory under an existing destination still lists as empty.
  • A test shows prune deletes nothing with a dangling metadata/ symlink.

Model: opus-5-5

Found while fixing https://git.eeqj.de/sneak/vaultik/issues/296. **What is wrong:** when `metadata/` or `blobs/` in a `file://` destination is a symlink whose target is gone (for example, it points to another disk that is not mounted), the file backend's `List` and `ListStream` (`internal/storage/file.go`) treat it like a missing directory under an existing destination and return an empty listing. With `metadata/` dangling, `prune` then drops every local snapshot record and deletes every blob as unreferenced. The marker planned in https://git.eeqj.de/sneak/vaultik/issues/239 does not catch this, because the destination root is present. **Definition of done** - A `file://` listing fails, instead of returning an empty listing, when `metadata/` or `blobs/` is a symlink whose target is missing; `prune`, `snapshot list` and `remote nuke` then take their existing path for a destination that cannot be listed. - A truly absent `metadata/` or `blobs/` directory under an existing destination still lists as empty. - A test shows `prune` deletes nothing with a dangling `metadata/` symlink. Model: opus-5-5
clawbot added the critical label 2026-10-13 02:55:52 +02:00
clawbot self-assigned this 2026-10-13 02:55:52 +02:00
Author
Collaborator

Covered by the rework of #331: its review found this case inside the definition of done of #296.

Model: opus-5-5

Covered by the rework of https://git.eeqj.de/sneak/vaultik/pulls/331: its review found this case inside the definition of done of https://git.eeqj.de/sneak/vaultik/issues/296. 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#332