-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear how to recover from "pack ID does not match" errors from "restic check" #2191
Comments
This sounds like pack 7691f738 is corrupt. What is the output of |
We've seen issues like this before. In some cases it was probably due to hardware failure. I agree it could be handled better. We had a lengthy discussion about it here: #1999 |
Is there any clarity on how to recover from a pack ID error? Would I be right in thinking I can just remove the corrupted pack? |
@jay-tuckey That depends a bit on the content of the pack file. You can move the damaged pack file somewhere else and create a copy of the Afterwards run |
Thanks @MichaelEischer , I can confirm that the process you described worked quite nicely. I think it would be nice to have some sort of repo-repair process built into the tool, but I'm sure there are other higher priority features to add first. 🙂 |
After #2827 has been merged, it is sufficient to run @jay-tuckey I propose you close this issue now that #2827 has been merged. Maybe open a new issue if you are not satisfied with or need more / better documentation. |
About repair functionalities, there is now #2876 - but redoing the backup is always the first and much better option.. |
@aawsome doesn't look like I can close it, I think @adsbarratt needs to. |
I have a similar problem and I do not know which issue fits better: #816 (is closed, but describes my problem best), #1999 or this one.
Backups have been performed after 2019-11-05 (the date stamp of the hash file), but it seems the blob could not be recovered. |
The standard procedure would be to create a backup of the repository index, move the damaged pack file out of the repository, then run I've rebased @fd0's debug-1999 branch to current master branch and added the functionality to extract all intact parts of the damaged pack file. You can use it as follows:
|
Thank you for your comment and assistance.
Building @fd0 's debug-1999 branch looks quite sophisticated (for me). If it somehow helps you and/or the restic team I would happily try this approach. If this is somehow risky and / or recovering the missing data could be achieved via the "standard procedure" I think I would recommend the simpler way. But please advice: which path should I choose? :) |
Yes it is enough to create a copy of the You can run The instructions to build the branch are as follows. Download a current version of the go compiler (at least go >= 1.13, use 1.15 if possible), make sure that you can call the compiler directly as
Afterwards you will have a new |
@MichaelEischer Wow, building restic was easier than expected! (I used go v1.14 from Debian/buster-backports).
I also ran
What shall I do with this info? Shall I check if each of the given files still exist? I now wait for
The last one is tricky. How do I know "If the missing blobs are part of a file of which you still have the original"? Anyway! Thank you so much for your help and effort @MichaelEischer ! Very much appreciated! |
As only one of the three blobs in the pack files is damaged, you can focus the search for affected files a bit more:
I probably should have worded this the other way round: Just run a normal backup at the end (using restic 0.10.0). If a file which contains the missing blob still exists, then backup will pick that blob up again and thus fix the repository. To know whether that has worked run check afterwards. |
What a journey! I think the finish line is close! 😉
I put the output of
All files still exist and although not exactly the same (the sha256sum differs of each of the files) the date stamps date back between 4th and 6th November 2019.
But here we have a problem: the files exist (although I can not 100% guarantee that the blob is part of the files, how to check that?) and backups were taken of these files in the meanwhile but the repository has still not recovered. What to do? Just delete the pack file |
As long as the damaged pack file is still contained in the repository index, restic thinks that its blobs are already in the repository and won't back them up again. To remove the files from the repository index, move the pack |
Sorry, for the very long delay. (We switched to a new repository and this issue got stuck in the backlog). Finally took some time to bring this issue to an end. restic has been updated to 0.11 in the meanwhile, everything else stayed the same. As you said, I moved the pack
Analyzed the output of
Then I did another backup which reported errors (but "only" 4 files were not found. I expected all of the 15 files mentioned in
and finally run
Looks good, but the pack file
Now I am running I did not try |
Ok,
What now? |
@jkirk The unplanned backup run shouldn't cause any additional damage and the prune run failed during the initial integrity check so no harm done here either. It is possible that the damaged files had different filenames but still shared the same content, that would be a benign explanation for the too few reported file recoveries. The name of a pack file depends on the exact file content which also includes random bytes for encryption. This effectively guarantees that restic never creates the same pack filename again. The recovered file chunks are now stored in some other pack files. That is it is expected that the damaged pack file is not recreated. The |
Closing in favor of #828. |
Output of
restic version
restic 0.9.2 compiled with go1.10.3 on windows/amd64 (for initial backup and check)
restic 0.9.4 compiled with go1.11.4 on windows/amd64 (for later diagnosis)
How did you run restic exactly?
AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=foo
RESTIC_REPOSITORY=s3:https://s3.amazonaws.com/myrepo
RESTIC_PASSWORD=foo:bar
Ran
restic check --check-unused --read-data
against the repository after generating 3 snapshots.Output included:
What backend/server/service did you use to store the repository?
S3
Expected behavior
A simpe means of resolving the error, given that I still have the original data available locally.
Actual behavior
restic find --pack 7691f738
got me as far asbut it's unclear how I can resolve the issues. Will re-uploading the affected files and then running a forget on the repo simply replace the broken pack with the new version? (Admittedly in a new snapshot, but that's OK.)
Steps to reproduce the behavior
Upload ~1.5TB of data from a USB-attached SSD from a Windows server to an S3-hosted repo.
If it makes any difference, the upload was rate-limited and interrupted / restarted at a couple of points in order to adjust the rate limit. Unfortunately I'm not sure whether any of the affected files were being uploaded at the time.
Do you have any idea what may have caused this?
Possible I/O issue, as the drives are connected to a Windows server via a USB to SATA cable and at least once (although not while restic was running) the event log shows that Windows believes the drive was disconnected and reconnected (it wasn't).
Do you have an idea how to solve the issue?
Better worked example of recovering from issues raised by
restic check
, particularly when --read-data was used.Did restic help you or made you happy in any way?
Generally I've been very impressed with restic so far.
The text was updated successfully, but these errors were encountered: