mirror of
https://github.com/restic/restic.git
synced 2026-11-06 15:29:21 +00:00
Motivation: when listing pack files fails during prune (for example due
to a request timeout), the error was returned unwrapped and main printed
it with "%+v", which dumps a stack trace. As discussed in the issue, the
error needs one more level of wrapping before it can be treated as a
fatal error.
Approach: in decidePackAction, wrap an error from listing pack files
with errors.Fatalf("failed to list pack files: %v"). Errors that are
already fatal (e.g. ErrSizeNotMatching) and errors after context
cancellation are returned unchanged. The underlying error is preserved
via Unwrap. Retry log messages are unchanged; only the final error
output is shortened and says where the failure occurred.
Validation: `go test ./internal/repository/ -run Prune` and
`go test ./cmd/restic/ -run Prune` pass. The new test
TestPrunePackListError (backend whose pack list fails) fails without
the change and passes with it. I did not reproduce a real REST backend
timeout.
Report: https://github.com/restic/restic/issues/22120
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)
9 lines
375 B
Plaintext
9 lines
375 B
Plaintext
Enhancement: Show a concise error when listing pack files fails during `prune`
|
|
|
|
When listing the pack files of a repository failed during `prune`, for
|
|
example due to a request timeout, restic printed the error together with a
|
|
stack trace. Restic now reports a short error message that states that
|
|
listing the pack files failed.
|
|
|
|
https://github.com/restic/restic/issues/22120
|