A backup without --cron panics when a snapshot has more than one path #253

Closed
opened 2026-10-06 22:31:20 +02:00 by clawbot · 1 comment
Collaborator

Found while writing tests for #225, on next at 5d685f0.

snapshot create without --cron panics with close of closed channel on any snapshot that has two or more paths. One Scanner backs up every path of a snapshot (scanAllDirectories in internal/vaultik/snapshot.go calls Scan once per path), and Scan starts the progress reporter and defers Stop on each call (internal/snapshot/scanner.go). Stop closes the reporter's signal channel, so the second path's Stop panics. --cron turns the progress reporter off, which is why cron runs do not hit it.

Reproduce: a config with one snapshot whose paths lists two directories, then vaultik snapshot create without --cron.

Definition of done

  1. A backup without --cron of a snapshot with two or more paths completes, with the progress reporter started and stopped once per snapshot.
  2. A test backs up a two-path snapshot with the progress reporter on and asserts it completes and restores both paths.
  3. make check passes.

Model: opus-5-5

Found while writing tests for https://git.eeqj.de/sneak/vaultik/issues/225, on `next` at `5d685f0`. `snapshot create` without `--cron` panics with `close of closed channel` on any snapshot that has two or more `paths`. One `Scanner` backs up every path of a snapshot (`scanAllDirectories` in `internal/vaultik/snapshot.go` calls `Scan` once per path), and `Scan` starts the progress reporter and defers `Stop` on each call (`internal/snapshot/scanner.go`). `Stop` closes the reporter's signal channel, so the second path's `Stop` panics. `--cron` turns the progress reporter off, which is why cron runs do not hit it. Reproduce: a config with one snapshot whose `paths` lists two directories, then `vaultik snapshot create` without `--cron`. ## Definition of done 1. A backup without `--cron` of a snapshot with two or more `paths` completes, with the progress reporter started and stopped once per snapshot. 2. A test backs up a two-path snapshot with the progress reporter on and asserts it completes and restores both paths. 3. `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-06 22:59:40 +02:00
Author
Collaborator

Confirmed on next at 5d685f0 and fixed in #255. The progress reporter is now started and stopped once per snapshot, around the scans of all its paths, and Scan no longer starts or stops it. A new test backs up a two-path snapshot without --cron and restores both paths.

Model: opus-5-5

Confirmed on `next` at `5d685f0` and fixed in https://git.eeqj.de/sneak/vaultik/pulls/255. The progress reporter is now started and stopped once per snapshot, around the scans of all its paths, and `Scan` no longer starts or stops it. A new test backs up a two-path snapshot without `--cron` and restores both paths. Model: opus-5-5
Sign in to join this conversation.