Data does not exist, check successful on second attempt but Restic returns non-zero error code

Hi everyone,

I’ve been getting this error when I check a subset of data using the restic check command. Restic says that some data (e.g <data/678b2b6950>) does not exist. However, it also says that the check was successful on the second attempt.

I’m using Restic with an RClone backend to OneDrive so I won’t be too surprised if some data didn’t get retrieved correctly on the first try. I am more concerned by the fact that although the check was successful on the second try, restic still exits with a non-zero exit code and says that the repository is damaged and must be repaired.

I’ve followed the troubleshooting guide and repairing the index doesn’t seem to be doing any actual repairing and the issue still persists if I run the check command again.

Note: This error only happens on some subsets of data

Restic Version: restic 0.17.3 compiled with go1.23.3 on linux/amd64

Full command: restic -r rclone:onedrive:immich -v check --read-data-subset=6/14
Full output:

using temporary cache in /homelab/restic/cache/restic-check-cache-2901925569
create exclusive lock for repository
load indexes
check all packs
check snapshots, trees and blobs
[0:04] 100.00%  7 / 7 snapshots
read group #6 of 1811 data packs (out of total 25679 packs in 14 groups)
Load(<data/678b2b6950>, 17070913, 0) failed: <data/678b2b6950> does not exist
check successful on second attempt, original error download error: <data/678b2b6950> does not exist
Load(<data/ad0c63ee48>, 17005921, 0) failed: <data/ad0c63ee48> does not exist
check successful on second attempt, original error download error: <data/ad0c63ee48> does not exist
[4:04:55] 100.00%  1811 / 1811 packs
The repository is damaged and must be repaired. Please follow the troubleshooting guide at https://restic.readthedocs.io/en/stable/077_troubleshooting.html .
Fatal: repository contains errors

Thanks for your help and wonderful software!

Restic expects that backends do not incorrectly report “does not exist” at such high frequency. The fallback case check successful on second attempt, original error download error was not intended for such backend hickups but instead to detect data corruption. As such check fails with a repository contains errors message if the backend incorrectly reports a file as missing.

Trying to repair the repository can’t work as it can’t fix an unreliable backend (which seems to be the only problem here). I’ll have to think about how restic can retry downloading files incorrectly reported as missing without introducing too much delay.

1 Like

Retry temporary rclone backend errors by MichaelEischer · Pull Request #5251 · restic/restic · GitHub should improve the situation for flaky rclone backends, although I’m not particularly happy about that change. But I don’t see a good alternative to blindly retrying errors from rclone multiple times.

1 Like