Many months ago I performed restic check on a 2 TB repo (maybe for the 1st time) and received errors.
Sorry for my incomplete memory (and not having found notes abour what exactly I did back then, yet):
1st thing I did with restic was rebuilding the index. I’m not 100% sure what I did next (definitely I did further index rebuild runs, maybe some other operation if suggested by the program). Anyway at some point I decided to take a backup of the repo before doing anything further. (had got the impression I might be on a wrong path)
In lack of time, storage space and money (and due to having an intact repo with backup of my most important data) I did not progress on the issue.
Now I have an SSD-device big enough to continue working on that. (while still short of time)
I copied the broken repo to my 4 TB SSD and did a comparision of filenames with hashes I got using sha25sum.
What I found is that there are ~200 pack files with non matching hashes and all of them seem to have been written during successive backups I had taken. (on different days)
Additionally I did restic check --read-data with max verbosity
a) with current index-dir contents
b) after replacing the index-drirectory with tared states I obviously had created during my initial tries to repair before copying the repo to another device.
From a) I got (current=newest index-dir contents):
using temporary cache in /tmp/restic-check-cache-...
enter password for repository:
create exclusive lock for repository
load indexes
check all packs
pack ...: not referenced in any index
[...similar lines...]
166 additional files were found in the repo, which likely contain duplicate data.
This is non-critical, you can run `restic prune` to correct this.
check snapshots, trees and blobs
error for tree ...:
id ... not found in repository
error for tree ...:
tree ...: file "SOMElnkFILE" blob ... not found in index
error for tree ...:
id ... not found in repository
error for tree ...:
tree ...: file "SOMEmailboxFILE" blob ... not found in index
tree ...: file "SOMEmailboxFILE" blob ... not found in index
tree ...: file "SOMEmailboxFILE" blob ... not found in index
tree ...: file "SOMEmailboxFILE" blob ... not found in index
[...similar blocks...]
error for tree ...:
id ... not found in repository
[...similar errorblocks for trees of these 2 types ("blob not found in index" and "id not found in repository")...]
[0:03] 100.00% ... / ... snapshots
read all data
Pack ID does not match, want ...., got ....
[...similar lines... 24 in total, not ~200 as above with sha256sum]
[1:51:05] 100.00% ... / ... packs
Fatal: repository contains errors
Result of b) (after restoring older index backup):
using temporary cache in /tmp/restic-check-cache-...
enter password for repository:
create exclusive lock for repository
load indexes
Load(<index/...>, 0, 0) returned error, retrying after ...ms: invalid data returned
error: error loading index ...: load(<index/...>): invalid data returned
Fatal: LoadIndex returned errors
Result of b) (after restoring NEWER index backup):
using temporary cache in /tmp/restic-check-cache-...
enter password for repository:
create exclusive lock for repository
load indexes
check all packs
pack ...: not referenced in any index
[...similar lines...]
300 additional files were found in the repo, which likely contain duplicate data.
This is non-critical, you can run `restic prune` to correct this.
check snapshots, trees and blobs
error for tree ...:
tree ...: file "SOMEmd5FILE05" blob ... not found in index
tree ...: file "SOMEmd5FILE06" blob ... not found in index
error for tree ...:
tree ...: file "SOMEmd5FILE05" blob ... not found in index
tree ...: file "SOMEmd5FILE06" blob ... not found in index
error for tree ...:
tree ...: file "SOMEpdf" blob ... not found in index
[...similar lines...]
error for tree ...:
[...similar details about blobs not found in index as above...]
[...further blocks about trees with blobs not found in index]
error for tree ...:
tree ...: file "SOMEpropertiesFILE" blob ... not found in index
error for tree ...:
id ... not found in repository
error for tree ...:
id ... not found in repository
[0:03] 100.00% .../ ... snapshots
read all data
Pack ID does not match, want ..., got ...
[further similar lines]
[1:50:55] 100.00% ... / ... packs
Fatal: repository contains errors
Is it a sensible option to try with restored index-dir contents? (vs possible inconsistencies that are capable of making things even worse)
Any idea what might have corrupted the repo?
How would you recommend to proceed? (if at all)
Many thanks in davance!
Versions used for backups:
restic_0.9.6_windows_amd64.exe
restic_0.11.0_windows_amd64.exe (date of files with unmatching hash is before updating to this version)
Version used for check back then and rebuilding index:
restic_0.11.0_windows_amd64.exe
Version now used for investigation:
restic 0.16.0 in Linux