From 7dab11303517616a96d56cc7cdf01aaa309ab90a Mon Sep 17 00:00:00 2001 From: tWido Date: Sun, 20 Dec 2020 21:12:27 +0100 Subject: [PATCH] Don't retry when "Permission denied" occurs in local backend --- changelog/unreleased/issue-2453 | 6 ++++-- internal/backend/local/local.go | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/changelog/unreleased/issue-2453 b/changelog/unreleased/issue-2453 index 0e91b8c05..31e85ec00 100644 --- a/changelog/unreleased/issue-2453 +++ b/changelog/unreleased/issue-2453 @@ -5,8 +5,10 @@ restic retries the failing operation up to nine times (for a total of ten attempts). It used to retry all backend operations, but now detects some permanent error conditions so it can report fatal errors earlier. -Permanent failures include local disks being full and SSH connections -dropping. +Permanent failures include local disks being full, SSH connections +dropping and permission errors. https://github.com/restic/restic/issues/2453 https://github.com/restic/restic/pull/3170 +https://github.com/restic/restic/issues/3180 +https://github.com/restic/restic/pull/3181 diff --git a/internal/backend/local/local.go b/internal/backend/local/local.go index acb4751fc..c195bdc07 100644 --- a/internal/backend/local/local.go +++ b/internal/backend/local/local.go @@ -91,9 +91,8 @@ func (b *Local) Save(ctx context.Context, h restic.Handle, rd restic.RewindReade filename := b.Filename(h) defer func() { - // Mark non-retriable errors as such (currently only - // "no space left on device"). - if errors.Is(err, syscall.ENOSPC) { + // Mark non-retriable errors as such + if errors.Is(err, syscall.ENOSPC) || os.IsPermission(err) { err = backoff.Permanent(err) } }()