Skip to content
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

restic prune fatal not found in the new index - "data blobs seem to be missing" #3123

Closed
ldhieu opened this issue Nov 26, 2020 · 17 comments
Closed
Labels
state: need feedback waiting for feedback, e.g. from the submitter

Comments

@ldhieu
Copy link

ldhieu commented Nov 26, 2020

Output of restic version

restic 0.11.0 compiled with go1.15.3 on windows/amd64

How did you run restic exactly?

$env:GODEBUG="asyncpreemptoff=1"
restic -r "local:\\10.199.198.1\morgane" prune --verbose=2

What backend/server/service did you use to store the repository?

I'm using a samba server, mounted on Windows, both sides are connected via OpenVPN.
The server is running alpine linux 5.4.72-0-virt x86_64 and samba-4.12.9-r0

Expected behavior

Prune should run without error.

Actual behavior

restic -r "local:\\10.199.198.1\morgane" prune --verbose=2
enter password for repository:
repository 3b1477ff opened successfully, password is correct
counting files in repo
building new index for repo
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 552.330144ms: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 1.080381816s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 1.31013006s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 1.582392691s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 2.340488664s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 4.506218855s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 3.221479586s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 5.608623477s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 7.649837917s: EOF
Load(<data/121711b4f0>, 591, 4696600) returned error, retrying after 15.394871241s: EOF
pack file cannot be listed 121711b4f0a2e5841f29c8abd3b74289b2daa0ee0843ea0058ce068fcd62d8ea: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 507.606314ms: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 985.229971ms: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 803.546856ms: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 1.486109007s: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 2.070709754s: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 3.67875363s: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 4.459624189s: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 6.775444383s: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 15.10932531s: EOF
Load(<data/3529c76718>, 591, 4930671) returned error, retrying after 13.811796615s: EOF
pack file cannot be listed 3529c7671832b0325c75eb18775fdbb327bb5d3b43638768aaf5177de0b21973: EOF
[6:41] 100.00%  66456 / 66456 packs
incomplete pack file (will be removed): 01bbfbba1443302f8be40e1f0b97efb588f51d643ffca059f8326b2d8b351b06
incomplete pack file (will be removed): 0b7d96dda6f1512a218b2200e49c185a97ac72789d99a426470593eb62b9abc7
incomplete pack file (will be removed): 0e50ff018f2a51731f38a0778c8b0cff6b2d1ea0ef62ba9fe10ed09303d923af
incomplete pack file (will be removed): 0e64f67054e9a2dc862a7e8fe4a24df0b20bd7a0d70cb9bb58aa012686371a49
incomplete pack file (will be removed): 101a65fe8f1c0e327697e2836c64959b63a3797b59ee16ce6de73824168d7003
incomplete pack file (will be removed): 14628541fa52185341de9f91eccab9ff33511db18377bde2107d4e74bafe8035
incomplete pack file (will be removed): 15658c11c965f10416a0d6a3408e5200ba08198fbbbbaa4bd86d74c2d39a4b48
incomplete pack file (will be removed): 169d22cf9c81a0642a71561f193fc66f328d7b27a4fa04eacbf553620526da38
incomplete pack file (will be removed): 16f52a1526195b2e2ad44d713987ff6ba8b605d4a69ff9a62ea1c20161800992
incomplete pack file (will be removed): 1715e869c90b86858263036aac4ff35d8fec04b5625eb9f30f9a2821c8e07279
incomplete pack file (will be removed): 198d8e28645a0241a40646024cfa21b976b4ab7112a6b2d3207dde9eea0309bd
incomplete pack file (will be removed): 1edb6109c1681d01682cea267d7150600da55b9c8fd5c312a593e5c35c1fcde0
incomplete pack file (will be removed): 200a29ff248600600b7bba18a6c76131bde0ad9d2eda1043837ea621c3102746
incomplete pack file (will be removed): 20bd82a37b3bf0601f2abd80cbe72755ae17bbcdb5262c49c5d56540f24957b0
incomplete pack file (will be removed): 228c92c841bba5367905c7cc74b66fb9f346a35970723d51e68e57eb68a40a7b
incomplete pack file (will be removed): 22a0297305875e66fa3a50135c795d373e3a31c286e5182a71a9f57c4d92825e
incomplete pack file (will be removed): 22b74566c39189854f0435717cdc2176109b3f3df5fe1417e5ad624384f1774a
incomplete pack file (will be removed): 233ab47dc516da28abe3fee29b0e5c4136127c3cef40492ae6d3fbe05b77ab66
incomplete pack file (will be removed): 24bfb647557d5412866b4cf47b30cb6b354ac7a9d3adc754232e451b86127294
incomplete pack file (will be removed): 2893a7916adc4f1833ea1c6527503c3d8871c40634dbaeef12c04526c03451fa
incomplete pack file (will be removed): 28ab16a8f8536283f4265fcf36bde89a0a5e68e4f8921e2e29577ad6af837778
incomplete pack file (will be removed): 2d55ce81a6feb743b3b17132488a3475ff0980310f6dc27f0351c3ea71ef6f71
incomplete pack file (will be removed): 308135349700d4e4c3fbe4470d595ae7ae44c7da2185809c8f0dd769aa5863e3
incomplete pack file (will be removed): 341366aedd8adf668292e20abdec12a7aff698be98f228459319f7a21cdb3adc
incomplete pack file (will be removed): 358c4291a879440a2e210a77740be264e870e77841476453b22c6aa08b15496e
incomplete pack file (will be removed): 35c52cdf3af540c792706e5b7714e90d035cc0acffb7849d337e4747fb4086e4
incomplete pack file (will be removed): 3892da70bfb6a5e5787f3c361ee6e7c8510e85d590205a3ac3e59f3cf8fdcc10
incomplete pack file (will be removed): 3b6f9f2869148c220807543742bc8c6368cde7f323b22844616b1bcf5bd4b901
incomplete pack file (will be removed): 3d55bd8514aff7b5030c62226968f39748d85e80856c87d3b0d33f141893dfaa
incomplete pack file (will be removed): 3fb1135e59efc97bf24a3332d9a45a061793b351ef164d93839beb4f4c61f20b
incomplete pack file (will be removed): 41feb5b4ce16cb9599a42c7af9f1bf211c617626242d5dfdb9ce349b84a54a5c
incomplete pack file (will be removed): 42d715b69de7884cb629bf35fc1d2495aa67e6304aea6a29351d25d1c761c2a9
incomplete pack file (will be removed): 442c013aa4f6f1df25ad0505fbbd401b570a5e9b69e8a88f02c565518762ed18
incomplete pack file (will be removed): 44f9ad5bcb2bbe0a80c14dc1b7de07287b9f80f9e0abb653467b5ecdff00b421
incomplete pack file (will be removed): 4def1a90b077e32baa7a4cdd59788c98cef2844603f69478e4620437eee55607
incomplete pack file (will be removed): 4eca069ae96088d7162cbe9d5e577e0ae68fca2fbe05018dd4def340222984c4
incomplete pack file (will be removed): 53b0df5e37ea81c0f5d671a401891900d88a4dd5d2436d5203d4847a5998489e
incomplete pack file (will be removed): 53bb37176490b33b3d58268cc3238d3a4858745483a088dbb64a3f23d838ddd5
incomplete pack file (will be removed): 54015a220e66b195cf31befc515acbc6710d8570e7b597236c7e3858881a2db2
incomplete pack file (will be removed): 568b63ab06e181089f31ef099b3aee0e468a5ed58f936ea4256c255a93596c31
incomplete pack file (will be removed): 576e1aee029e2eb814472bb822d7200d726292f46400e152410969b9458547f1
incomplete pack file (will be removed): 5a57130fa6823c795a84d96dea84d2c92a2733b89d9d0d29fedebabc767bd42a
incomplete pack file (will be removed): 5bfadd6fb5f0eb6e8d452e8a5e1ff98695fe425acf57785ebaf117fb5aaac449
incomplete pack file (will be removed): 5c533649be7580919fa4e99fa61ace922afa83c16cac6444f93a43355f9fa295
incomplete pack file (will be removed): 5efedf5cacbc20b122a1d8cb8b6dde57f359ecd375cd3d896d943a16a65f0805
incomplete pack file (will be removed): 620e7382e72099036d8e07432bd9785d4514835c3b9e440350e4d00054c9a18f
incomplete pack file (will be removed): 62665316765ff06f76be8b2a50db85c5e89639cb6427758626a90c6f74b9d462
incomplete pack file (will be removed): 65305bf215f05cf76a6b00f864876432704c9103a6bd32e21962b64fb89bebbe
incomplete pack file (will be removed): 65ca351a76379b57860686d61bb96a47dd4897c5f60b1a117f79434fe90742f9
incomplete pack file (will be removed): 66510076cfae80c796b4e8784b65834279a6622ea27f085506b540d3f60d9b21
incomplete pack file (will be removed): 669dd042681ccb7da400be408ec06871486d85eb2eb082a58b669d8fd238c0ce
incomplete pack file (will be removed): 69e5a10486eb1a6535d67d2c37b4bbbc5eb2210c732e1f48e67dd84a37828914
incomplete pack file (will be removed): 6c8c24149fefa1aae10cd9e4bb0dc39533f4521b6b45baca303c699e831c6ac5
incomplete pack file (will be removed): 6d1f3dda3816f34a2b67a9d825b46fd1c04070b880f8524de7e203fb7a6d130a
incomplete pack file (will be removed): 6e2daf44c62918d22f766e72645c61407cd6fbe97aef2f2d44be086739f65463
incomplete pack file (will be removed): 6e8ea2b0510fca9a087071000166e4610417971405423020a0132a99728a4b91
incomplete pack file (will be removed): 6f6914deff5b8c0715b6f9644094bd45074901614b534d7998b80ec3a65033bc
incomplete pack file (will be removed): 704b1afb874b8e12232d1535b7c47b9d92933c96381357e2428341576a26fb6e
incomplete pack file (will be removed): 72634c59746b14135b4eb03e94b0ba12bd95ccd1d396b9a9a3238f0bda38e72c
incomplete pack file (will be removed): 7388068f13e5e59194d02162ffa37b2b3478f24101a129936120df6bef10c1e8
incomplete pack file (will be removed): 77cceb241e29f38586c721ffa31dad38a296faabdc15cb20066adfde9c8effc6
incomplete pack file (will be removed): 7c25228a8447e2b2760f3c39402ab2b209810489c34c1d6f2e900e022a386d1f
incomplete pack file (will be removed): 7ee1f444b29913a2a15cb4933fb07bca3a493f8a795ee55616c14c1129123c90
incomplete pack file (will be removed): 7f01567a5337fda9eb6b27d8c1e9733953a1c737eb900e45e17a43aa62ea1b6c
incomplete pack file (will be removed): 815ee8678ebec56f365334c463246c99b4f86f8aa7d99812bcc0cf47ea909a3b
incomplete pack file (will be removed): 81674647a0a31ca7d58f701b8fc204ed69293986abdb196a5ecc5f4e6f65f2b9
incomplete pack file (will be removed): 858c8f85e7b2b9a4c975c35d64339e4b80474b99f32974e802eae1e88f89cb8e
incomplete pack file (will be removed): 8636d659576556503f6e9487374c96582b133dadeb900c8bb64c4345f9518162
incomplete pack file (will be removed): 876be24f95023caecb5762f64f79da602b28a724705eee39856b3f21733fda50
incomplete pack file (will be removed): 8771a8937e878750cbfa5d073267de9d5ede4af68d98d8fe9a545f93d0a17e52
incomplete pack file (will be removed): 87733621844537750fac6964ae7173f5db25304b8d20df99353f38fd85ae9243
incomplete pack file (will be removed): 87e910cc21ef7e6c8003c2e97348e594c975ef580e97d700a0da09628b561158
incomplete pack file (will be removed): 891fe6b57b1ebd955ac4d967a40edee2c2f699c4fbddff1d6201bae4fb92982e
incomplete pack file (will be removed): 8c45052bfb6a2a560b0967b43253e2df5ca94219395ec1150d78c8ade051037b
incomplete pack file (will be removed): 8c65f58507e1f10540025f81a754ec462415b1917779f3539e8b0c5184cc7eb8
incomplete pack file (will be removed): 8f6fb8fe394c22dfcf0b23a2dc7240f07d10e329b717d29f513de56be2ee3c69
incomplete pack file (will be removed): 9019537bde372702403093460e093fa06c5a9a6674c0bb78bf1a6ee26560bae8
incomplete pack file (will be removed): 9457e2625c7d735d63b6d1b780a0a2f57cae3cc9ac27203e0b2fb5102dd173e7
incomplete pack file (will be removed): 947f34d8870af1f63ad431b7147f08a7c1a8a67312e7d59093ab76fb006f2e56
incomplete pack file (will be removed): 986a1709af1da4a67e44d999088fa559a8f94de2b136200fe70ccf47d4063ada
incomplete pack file (will be removed): 98fb369c5dba7027c1c08e2081e4dcdb6aee97d06d3c703b0de97c02f9090d92
incomplete pack file (will be removed): 995fffb60671eb9beeb038d10b9fbb4366b8873dd2136aa082bb2fd2d4592af3
incomplete pack file (will be removed): 9c174485477026c0b8d14e91f85a3aa656103fab2f080603e11172d0f5782824
incomplete pack file (will be removed): 9c471e4efdea08e1af474ad8cb858ac4709b6f10b735f92a3c2a5cdfcece7654
incomplete pack file (will be removed): 9f3c8fa454fe998f2486fdc2a80a58dadf21f179536bd9e69fa587f98fcec703
incomplete pack file (will be removed): 9fbe6405c883aeb81b4e56f07badc244d1895f276db7614bd841a563739e5b9f
incomplete pack file (will be removed): 9fea7934f36b6fb5e1bb2fe297f0efcca0df5da9c97a43412fc9e29420764a7b
incomplete pack file (will be removed): a2b567082209eedd773d756523af1c20c4b4564ce23675483ad003611095056b
incomplete pack file (will be removed): a3a819ab453e11aee79870ea7541e4315b125808485248d79a609781127f2f8c
incomplete pack file (will be removed): a8173f14ec492e7a1eb5014589583ad4ded9fb089d5467e308b7c610e40ecab4
incomplete pack file (will be removed): a8c3e4570b47f0e06d1e5539a0b19ce9ef748dddf83858ffee11eacc55fde0b0
incomplete pack file (will be removed): a97258b623f11e148c34d326f2b4708e260af0c7e7ec21d189f8a9f076ab666f
incomplete pack file (will be removed): aa8f4c3624830863967ede9b9c7ca345b278090c2fb0d6c7915975ca7597af73
incomplete pack file (will be removed): af40b8349994da9a8e905606cc93b3fca206c2da3bb2250987f8534588fa1f50
incomplete pack file (will be removed): b2cf3f39179864dc76eb33d4876430de5250d922c6387ffcb30133ea580a6ec6
incomplete pack file (will be removed): b2d87756b66795d5b71c0fedea212c3bf706fadfa57b8358d970325452d99569
incomplete pack file (will be removed): b3ddb21b16f092079dab65836fe7341d0d5267f1304de016661c27c06d12cbc1
incomplete pack file (will be removed): b49ad20d191836cbed3a7909c42ca97dfbda08a949036a9a63ac031b3cac0e76
incomplete pack file (will be removed): b99195582fc7c5c27ac8c7f58607f8fdc8c449884c57473233332c31443e9d25
incomplete pack file (will be removed): bac39ca3de0a43a48336a2e8dedfcdaffe4c4180a91fc30518126368a5677394
incomplete pack file (will be removed): bda7cfcc76db93919e1d9da38ecd148746bc9d3510d66131ea2c4f01b4e27b2c
incomplete pack file (will be removed): bee5cc73bf7fc981306e0a5c98b68db1d561f80850b9ac36ecb560a7528be2d7
incomplete pack file (will be removed): bf8ad16e0ef72f4002b34d5504d7520402b405fa6c44b45afff262ae627a4b6e
incomplete pack file (will be removed): c07d63bbf4569fcc15f799fed1814e241c4c19eb55a744879aba56e8a0dc6750
incomplete pack file (will be removed): c339ba4fd959a16c7e16bbd27dd56b65e85b9a53c705376840dd6fd4fca7f4b3
incomplete pack file (will be removed): c45bd28d607546a2bb6f565d7cbc5006458e2336189826b17d106861c90e9958
incomplete pack file (will be removed): c5b69da7808eccde9e75176f94ab92f5de814d621a00e5513d6f0414dd571780
incomplete pack file (will be removed): c6b5b98de1a50da1a988f8e5b83c49e4a0be4c2f8f2e95f2ee399c64444e2620
incomplete pack file (will be removed): c82f92d1b2ad34cc12cab842c90139119270e2fe1861b2ddfb046862f8cb1f1b
incomplete pack file (will be removed): c9ca79c889332928b8ffc98a6331ccfe1ab5cfff161e21b2f54b74c55960c0c2
incomplete pack file (will be removed): cb35eb96cc8a8a6ce8cd02f3566d5ac07fe9bae3656a7a797b19b585a361bba1
incomplete pack file (will be removed): cd5788b5b2efd5e68d7fee4a8f12cfa5014ca4c66bde2cd046d635d855115cbe
incomplete pack file (will be removed): cda1740755069f782c31d9eba8937dd84806c45ec9b817b8b2321ce40a1b8589
incomplete pack file (will be removed): cf56eccc5ea9435ab8d3cbc9372ae07aef43a0e0ab2160bc009c3b0d48a24ea7
incomplete pack file (will be removed): d2553b2ac3c0f8a13c87c061f7463cc4f62c1078a0e4f466219d330ad2c67ab1
incomplete pack file (will be removed): d28324bd6261dda26a7f1f5cce514c89d85eec8a2ce87126c4521342565e3a03
incomplete pack file (will be removed): d57fb1cf8dd8bd2bdea91250eda07968c854fb62c993c7c4f8c959452791618c
incomplete pack file (will be removed): dead66fa9d77e18d150d6f0231f2c47f100e334d13fe1c9d784719ea72f72f99
incomplete pack file (will be removed): e0592f55b5b56795bbcb734d5db843f2409ef0a6b32227318e54b04e8ef773f5
incomplete pack file (will be removed): e0bc829f0bc713ff6350a4aeb53d6845a527737a7aa4b6a4f5ffbe00798ad249
incomplete pack file (will be removed): e736568cb38289191c38f429fc02cfe105292d772668624497750f2215832268
incomplete pack file (will be removed): e765656b8afbcc0a572766fd2d18a5485e1595a60ddc62876d2a1c0d977b0785
incomplete pack file (will be removed): e782bb53446a68e1ee6f1a66b06a63b4afac4e2a0dd528b24409c727e3b84920
incomplete pack file (will be removed): e7bd3365762efb050e035e5668a3f8b6615653f518d7a99f4fd11a34d2b018fa
incomplete pack file (will be removed): ea6fbf4042f2dd78b834b385bfa31b163a4b908f400b4425399ea3580e99d0b6
incomplete pack file (will be removed): ebdcf467f61e540466673b4f01305a0b0e680dde1396ea044aca183a0705eb38
incomplete pack file (will be removed): efa963cd903ae9010575697bd91e484f7b848687610b302fbf83f4b53dd08a90
incomplete pack file (will be removed): f4fac8c27373d1e54cbde9fafbe014fc52dbfea23cc2fe8ff9d2a7197a91c0e4
incomplete pack file (will be removed): f7c10eb112fb7e985f8dd83ecbd18e2b45367de5e29d9ceaee0a209c104d29d4
incomplete pack file (will be removed): f8a4cda36fd70a3b0c73f4ed315c36a0e1824c219acb4a4ef3469b1c3bcf34fb
incomplete pack file (will be removed): f99702e6b571a4a494eeb08e5c8dd4387f70bc4fa3bfd9cedf6f05213d103e0a
incomplete pack file (will be removed): fa0e240ef605afc9dfa387a9a0c00c51d112f7abbe97e206eb9b65c1bfa976dc
repository contains 66322 packs (297477 blobs) with 317.253 GiB
processed 297477 blobs: 30854 duplicate blobs, 33.827 GiB duplicate
load all snapshots
find data that is still in use for 6 snapshots
[0:02] 100.00%  6 / 6 snapshots
Fatal: [<data/6ebb2b82> <data/da498070> <data/1daf87c0> <data/d5b7988a> <data/f9f6bec8> <data/8b044261> <data/4869b5b8> <data/c127f59c> <data/f8579293> <data/3d899bd7> <data/f63aef02> <data/b56c4b0c> <data/8aac9d21> <data/0919912a> <data/829ca4a3>] not found in the new index
Data blobs seem to be missing, aborting prune to prevent further data loss!
Please report this error (along with the output of the 'prune' run) at
https://github.com/restic/restic/issues/new/choose

Steps to reproduce the behavior

  1. restic -r $remote-place backup --verbose=2 --tag $tag $local-place
  2. restic -r $remote-place check --read-data --verbose=2
  3. restic -r $remote-place prune --verbose=2

Do you have any idea what may have caused this?

I believe this was due to backing up the directory via SFTP first, which had some errors (it seemed like it was related to ServerAliveInterval, however I tried different things after searching online, but it did not fix it, SFTP always failed after a while).
This means I'm pretty sure the server had some bad files (in the middle of writing but got cut off).

So I had to switch to samba + mounting it via OpenVPN instead. I re-ran the backup from start, with the same tag. Then ran it again with backup --force --no-cache.
After that, I ran check, then check --read-data, then prune and got the error above.

Do you have an idea how to solve the issue?

I'm not sure. I'd like an option to do a backup that goes through all files again to make sure no data is corrupted. Is there any way to do this?

Did restic help you today? Did it make you happy in any way?

I like restic. I tried backing up with: rdiff-backup, borg, and duplicity; restic was not only the fastest one but the one that did not choke on backing up in my particular case (except for that sftp error which I still have not figured out why).

@aawsome
Copy link
Contributor

aawsome commented Nov 26, 2020

I'm not sure. I'd like an option to do a backup that goes through all files again to make sure no data is corrupted. Is there any way to do this?

This is what the check command should do.

In your example, did check print out no warning? If yes, can you retry the check with the latest beta build? It could be that this is an example of a repository error that is only found with #3082, which is not included in 0.11.0

@MichaelEischer
Copy link
Member

There are also beta build available at https://beta.restic.net/?sort=time&order=desc .

The problem is probably caused by the two pack files which failed listing. Please check whether the files in data/12/121711b4f0a2e5841f29c8abd3b74289b2daa0ee0843ea0058ce068fcd62d8ea and data/35/3529c7671832b0325c75eb18775fdbb327bb5d3b43638768aaf5177de0b21973 have 4697191 and 4931262 bytes, respectively. Please also run shasum -a 256 <filename> (on the server) and check that their hash and filename match. As you mentioned that the backup was initially created using SFTP, it might be a good idea to check the file permissions, too.

@MichaelEischer MichaelEischer added the state: need feedback waiting for feedback, e.g. from the submitter label Nov 29, 2020
@ldhieu
Copy link
Author

ldhieu commented Dec 1, 2020

I will get the latest beta build and retry check

@MichaelEischer

both files have the right sha256sum as their filename, but the file sizes are different

I'm not sure. I'd like an option to do a backup that goes through all files again to make sure no data is corrupted. Is there any way to do this?
This is what the check command should do.

I meant a command to backup everything again and not trust previous data, not just check the data. Ideally that would be run for critical sections that I want to make double sure is included in the data backup.

@ldhieu
Copy link
Author

ldhieu commented Dec 2, 2020

Hello,

I've retried check --read-data with latest beta build, and it's still displaying this:

7155 additional files were found in the repo, which likely contain duplicate data.
You can run `restic prune` to correct this.
check snapshots, trees and blobs
read all data
[10:43:37] 100.00%  59301 / 59301 packs
no errors were found

I would like to backup again but making sure that both packs are re-written again (e.g. akin to deleting those two files and backing up again). Is this doable?

@aawsome
Copy link
Contributor

aawsome commented Dec 2, 2020

I would like to backup again but making sure that both packs are re-written again (e.g. akin to deleting those two files and backing up again). Is this doable?

You can manually delete or move them, then run restic rebuild-index followed by a normal backup run. If there was any data needed in those removed packs (and still available in the source to backup) , restic will add it again. Make sure you run a restic check after to check that the backup really added all needed data.

However, your situation is a bit weird. If check --read-data does not find any error, prune should also run. So this seems to me like your backend does not produce stable results to restic which would be a bad situation.

I would be interested in the output of prune --dry-run from the beta builds. (Note the dry run option is only available in the beta builds) - can you try this out?

@firecat53
Copy link

I had an identical error message to OP on restic prune but with the B2
backend.

TL;DR - using the latest beta build and running prune, then check again seemed
to correct the issue.

Original error message using 0.11.0:

restic 0.11.0 compiled with go1.15.3 on linux/amd64

# /etc/systemd/system/restic_prune.service
[Unit]
Description=Prune Restic Backups
Before=restic_check.service
After=restic_forget.service

[Service]
Type=oneshot
EnvironmentFile=/root/.restic_backup_env
ExecStart=/usr/local/bin/restic prune

[Install]
WantedBy=restic_prune.target

-- Journal begins at Mon 2020-11-30 15:09:21 PST, ends at Thu 2020-12-17 13:02:49 PST. --
Dec 17 09:19:06 homeserver systemd[1]: Starting Prune Restic Backups...
Dec 17 09:19:17 homeserver restic[2000365]: counting files in repo
Dec 17 09:19:36 homeserver restic[2000365]: building new index for repo
Dec 17 12:19:04 homeserver restic[2000365]: [2:59:27] 100.00%  104017 / 104017 packs
Dec 17 12:19:04 homeserver restic[2000365]: incomplete pack file (will be removed): 53b623518df312038ae50cd8a81ed89837805725d45f708bd37c6ed2a6f480eb
Dec 17 12:19:04 homeserver restic[2000365]: incomplete pack file (will be removed): 575a87afd583b057d297452487d74a8924e3baf9c8af687b42b8d4f4be07daf6
Dec 17 12:19:04 homeserver restic[2000365]: repository contains 104015 packs (1409509 blobs) with 491.617 GiB
Dec 17 12:19:05 homeserver restic[2000365]: processed 1409509 blobs: 0 duplicate blobs, 0 B duplicate
Dec 17 12:19:05 homeserver restic[2000365]: load all snapshots
Dec 17 12:19:05 homeserver restic[2000365]: find data that is still in use for 41 snapshots
Dec 17 12:20:37 homeserver restic[2000365]: [1:31] 100.00%  41 / 41 snapshots
Dec 17 12:20:40 homeserver restic[2000365]: Fatal: [<data/73ceca2e> <data/a142b435> <data/519e561c> <data/13844bdf> <data/6ad9bdd5> <data/dd2231c5> <data/d67072ba> <data/e581530c> <data/ba1cecfc> <data/ec168302> <data/420976f5> <data/e26812c0> <data/1e121c3f> <data/ded5d9fb> <data/c0486fe9> <data/77ac0981> <data/99dd467c>] not found in the new index
Dec 17 12:20:40 homeserver restic[2000365]: Data blobs seem to be missing, aborting prune to prevent further data loss!
Dec 17 12:20:40 homeserver restic[2000365]: Please report this error (along with the output of the 'prune' run) at
Dec 17 12:20:40 homeserver restic[2000365]: https://github.com/restic/restic/issues/new/choose
Dec 17 12:20:40 homeserver systemd[1]: restic_prune.service: Main process exited, code=exited, status=1/FAILURE
Dec 17 12:20:40 homeserver systemd[1]: restic_prune.service: Failed with result 'exit-code'.
Dec 17 12:20:40 homeserver systemd[1]: Failed to start Prune Restic Backups.

Immediately afterwards, using the restic beta version (dry run prune, then
prune, then check).

restic 0.11.0-dev (compiled manually) compiled with go1.15.6 on linux/amd64


[root@homeserver ~]# ./restic-beta prune -n -v 2
repository 5451d26a opened successfully, password is correct
loading indexes...
loading all snapshots...
finding data that is still in use for 41 snapshots
[1:27] 100.00%  41 / 41 snapshots
searching used packs...
collecting packs for deletion and repacking
[0:20] 100.00%  104017 / 104017 packs processed

used:           1379956 blobs / 485.838 GiB
unused:           29570 blobs / 5.736 GiB
total:          1409526 blobs / 491.574 GiB
unused size: 1.17% of total size

to repack:            0 blobs / 0 B
this removes          0 blobs / 0 B
to delete:        11241 blobs / 4.613 GiB
total prune:      11241 blobs / 4.613 GiB
remaining:      1398285 blobs / 486.960 GiB
unused size after prune: 1.123 GiB (0.23% of remaining size)

totally used packs:     102300
partly used packs:         613
unused packs:             1104

to keep:       102913 packs
to repack:          0 packs
to delete:       1104 packs
Would have repacked and removed the following packs:
{}

Would have removed the following no longer used packs:
{00236b95 007afdf3 009d1c20 00c83051 00e96083 00f9775f 01512c0e 01b557b7
01ed3d5a 020b2153 027921bd 02848a4b 029d86b9 02b224a4 02f5b12c 0341397c 0410e6c7
04683ba6 0480a617 04b13ffd 050218ad 05543389 05a38233 05b66322 05dd80fd 05f6f3ea
06161a52 06249c8d 062ab866 0675c727 06cc870c 070f4977 0795c38b 07fc11bd 086cdafe
088fde41 08b6ea71 08cf2073 08f722db 09557c54 0959b085 09847ff9 09bcd16c 0a0320c8
0a74bc54 0a97cb5f 0ab5c954 0ae0abda 0afe6a5c 0b50388f 0b9ce8e2 0c2c5fb3 0cb17d43
0ce39cd3 0d1489b3 0d7ab874 0d8cfc0b 0dccff58 0dfbdc7a 0e184df4 0e19deb7 0e95298d
0ea1e042 0ec7973d 0ee42cab 0ee65781 0ef8044f 0f35d855 0fb729f7 10355125 104915c4
104ed28b 10587c85 118f7245 11e2f1a4 12497805 12b4c779 1364a7a4 136e105c 13e1c727
13ec1a76 13ed63fd 140ed75e 144d27d7 145da82e 146bcbee 148ac1bc 148b1b12 15169b1a
1545bac9 156a516b 159d0d2f 15ce1542 161446cf 16c9cf83 16d69a63 16ed17a0 16fd2561
1738fa17 1755938c 179b5b3a 179d90eb 17bbaac4 17c48913 17dbf971 18098b3f 1855fddf
18781c54 18d33ff0 18eb24f5 1903bb0d 1929c95f 1990a54f 1a0f3ae7 1a293d21 1a512860
1a778e10 1a808671 1aa26eef 1aa5c7af 1b3fe9cf 1b6214df 1c8bac1b 1c8c9fc0 1c8f752f
1cb11154 1e08910a 1e22865f 1e8a513e 1ef427b3 1f009f6a 1f4e413d 1f55abdf 1f806766
1fa18d5f 1fd6fcc5 1ff1e773 200748c2 2061dde9 20689048 20ef1acd 20fca8ec 21042bfa
2155c892 21ce85c6 220343e0 2213c3fe 22fa2e43 23ab9a5e 24aa8153 250c178f 25460ab2
254d0895 259c855b 25b2aaaa 25b7b7a2 25bdc49c 25d43541 25e310a1 25f90b29 2610c77f
2610df0c 26678e41 2732c9ea 27403220 274d9e38 278d9933 279f59e3 2804789c 28340338
28c4ea1f 2a0f9c21 2a146485 2a9cdacf 2af84636 2aff73c9 2b1f59ad 2bdb5ace 2be24175
2c1962fd 2c6009b9 2c93d550 2cadeccd 2cd404da 2d50d4f6 2d6192ae 2d946347 2dee179d
2ee5e85b 2f0f4375 2f4dce08 2f52c1e2 2fd92a11 2fe13820 2ff62b29 3032b055 308fc9d6
30e39f53 312d3886 31507e51 31517362 3177b849 318a4985 31e2317c 31f615e3 31f9f3df
32189cd8 32258713 3236763d 328c4b5b 32d82f59 32d942f2 32e50853 3362b608 336ef571
33717e4e 338891be 339a32ba 339b0967 33ac56e0 33c06c3d 33ee5f3f 33f7b151 342269dc
34726154 3476f32a 34ec5687 34ff4d34 35733594 359a8952 36d09530 36e8a8a4 36f07d45
375f207d 378448fd 37c84a84 383753ec 385c35fc 3866c0e5 38dca505 38e4b801 38eb534b
38f7753e 392ce929 39302b61 39601b1d 39d84351 3a1ae6ff 3a1d4d60 3a8a3fe6 3a9b2917
3aa8dc6a 3b001ddc 3b1b999f 3b49a9b8 3b68f8fa 3bb112bd 3bcd4816 3be39850 3c74894d
3ca9d7e1 3cd0588c 3d109c5f 3d126679 3d2eda3e 3d35dc35 3d42071b 3da0de0e 3daa0d8e
3e2c57b0 3e6f2cd8 3e791e50 3e9e8895 3f1fa31d 3f6ec49b 3fc09024 3fd6f098 4003a698
40572674 406c5499 40977593 40a504cc 40a60e24 4199509c 41c714d8 41d5ddff 41e2d597
421d884c 423af7e8 42a28d59 42aaeeda 430b9d27 434f320d 4385838a 4397f9ce 43c6dfe9
440072e8 443c3b50 4456dd8c 44597f36 4493cd4e 44a9144e 44c724f8 4511c5ad 4517c014
451d719d 453c425c 461c2443 464f359f 466917ea 46dfc236 46ee89d4 476f5ac8 47916c0d
479516f2 47a629f2 47c0effd 4808dac4 49239ce7 49a2f877 4a1f4c56 4ab9cdbd 4bae3fa2
4bb2d5cb 4bbbcd0d 4c2fdb60 4c770cd9 4c771996 4c84bf91 4cd09354 4cde1a81 4d196ced
4d6e5003 4dfdeb0d 4e117c96 4e1f78c3 4e2ea3d1 4e3b09a4 4e814272 4ec3ce81 4eeed6f1
4f22f3c9 4f412e87 4fc91999 50400b42 504aab64 509a095c 50b10bc7 50b6b77a 512180f0
514fceef 5162cea3 517a2fb9 51d9434f 5207a85d 520a83e6 523380f4 529b8cb9 52ae4055
52d715ba 52d77762 5310a30c 531a199c 5336b7c9 53424d69 539e7bf7 53d53cdf 53d912a5
53de8942 53df0008 54b246ef 54d798eb 55420f2c 55489e75 554f311b 5551c34a 556dd569
55c5aa65 5600f88c 56202439 57bb5c46 57d718b8 580aea4f 583d082f 58ce2f4d 590238e6
592da29e 59946178 599990be 5a415172 5a6d9e27 5a906731 5b13e7c6 5b2cae94 5b39e138
5b3ea479 5bd60eab 5be6bff1 5bfe9b2a 5c03eae2 5c23e0fc 5c2a4b6c 5d0f571d 5d1bdd71
5d234a77 5d855dbd 5dac1c9f 5db2df33 5db8477a 5e6eb3ff 5ed3e00d 5ee9d826 5f00d86e
5f118dac 5f41c182 5f42b608 60134b6c 6025877c 6033f90d 60428816 6055ee53 60a6635a
61562452 6156983c 61b25be6 61dee6b0 621f2588 624b8857 6264a7cf 62a02872 62a9a355
62c565c6 62f54b75 636400c3 63f4dcfd 643b204f 644fd57a 6490671c 64c61ea3 6530c4f3
65bbc37e 65f960d4 661f6eac 66df5982 67f3c4b4 6813e378 6822d822 68755f66 687e7e0c
68873589 689ab9db 68c17236 6963cb8d 69caa754 69f88b58 6a30cac5 6a62f784 6a727775
6a98cff3 6ad969f4 6ae1f2af 6b0da9c2 6b52b63b 6c27e45c 6c3d6ca4 6c7d16ca 6c862fc7
6c89d6a9 6cb67551 6ce6a30e 6d238db5 6db8be07 6dd202b5 6de0e4e0 6e0fab53 6e6ee47f
6ea82c16 6ee7aa1f 6f61fd26 701248d3 7012772c 701e812a 70637494 7078d14d 70953722
70be0bfc 70c47099 70d1bc43 7165a6f2 718b281e 71dd7cdc 726f28c6 727b234c 72895285
72992086 72a23015 72aa17a4 72d020da 733da60a 739027d6 73a80722 73be99bb 73f094b2
747f6a22 74a785f7 74b47a1b 751ea0df 75bdf641 75c3df0b 765d3fa9 76b228b1 76c6199a
76d872bf 77210820 778595d0 778e2f56 77a5bceb 77d8da18 77d993ff 786c5162 788560bb
78a86c4b 78a87be8 78ed60c4 791a1ff6 79a1f87c 79b3fa9d 79f48491 7a1d5576 7a241e7f
7a64186f 7b7264e4 7b764636 7bfe4e6e 7c79f34c 7c83f6cb 7cd44b0f 7d019ce6 7d3e4cde
7d5f4fcf 7d74bec7 7d891a1b 7d95b4ad 7da39265 7de41aa5 7e50b3e2 7f61ab6f 7f7b864c
7fab4a3e 7fefb46b 80873499 80b29e46 8154c721 819fec76 81b6f7ef 81dd6fd9 81ed7b15
81fc5fa5 81fcb70f 82179f99 82363827 8242456a 8251d2a4 825e52d9 826131dd 82e5d3ee
82e9bef1 831b7160 83701a85 83a48762 83a8ec7b 83dd3653 83f095c1 83fa6e42 840296e7
841ec34b 84d0da52 8516bb8f 853a5604 85d3ce22 85e791b1 860c4454 863d969f 8671ba31
8674879b 8676e971 86784f67 868357e7 86db7e4a 871f4f79 8739feda 879bc244 87c2658a
87ffccaa 88084a00 88a1c7b9 88e434df 890318a0 8905ac69 895877ea 8984f9b9 899f7d45
89ab85de 89e1b12b 89f835e6 8a13a969 8a522e7c 8a7554b9 8a756a1a 8aca0601 8ae51ec3
8b15bece 8b3b899b 8b7e7812 8c0be730 8ce9e808 8cf85584 8d555cce 8df058b8 8e2321f0
8e726ed9 8e7e644e 8e97be91 8eb8d8d7 8eeadbf3 8f1b5979 8f4435ac 900579e0 900b20ff
904d44a5 9064de78 90b0be9e 90bd721b 90eec9ef 915abb5b 91a7704b 91b58c4d 92232eb2
923cf265 92484293 9283180e 928a26ab 93299c60 93462dbf 9354061b 936f8f6e 93c05d96
93cd2a57 949fa7be 94b98e56 94be06dc 94c8b5e0 94ef38d3 9549c832 95764e51 95d6bf10
964059db 966617cc 968270e4 96d07282 9724a02e 97719125 97b6af89 97b6f4b0 97c15331
97c35a57 9832c44d 983f25f8 98662398 98838e75 9899c63d 98a6997d 98ff7d36 9904bf53
993de80b 99dde604 9a2146a6 9a7c030d 9a803b7a 9a9dd1f6 9aa043c2 9aabb997 9aca67bc
9ad85c41 9b43bb36 9b564fce 9c0e4765 9c5aed5c 9c6be1e1 9cd1172d 9d27b111 9d7cd417
9d7cff88 9d95394a 9dd738f6 9e0985c2 9e9355b1 9eb70927 9f256321 9f379c6d 9f53c558
9f91a1b2 9f942260 9fc296f0 9ff84d62 9fff72a3 a01b974f a042dee9 a04e3db9 a0eeb255
a11d25c9 a13d9be0 a13ed8af a16ae61e a18fa932 a1a0dc64 a1cf307c a20a8d63 a234b11f
a27ee7dc a303e7ba a3078088 a35f96f5 a38152e3 a3b7ef94 a3c2e67a a3d6d948 a416171b
a42c46a5 a48b3feb a4c5e268 a52f4d9d a5cb5094 a6615cfd a667f90b a6b61f66 a718ab18
a76b977c a78e3349 a87e0731 a8835f31 a8cb80c4 a8fd7ff7 a903a6d9 a91c98e3 a96caba1
a97f789c a9e6a8b2 aa2e61c2 aab2af65 aadc806e aae8e51c ab4b312b ab8b5598 abc25901
abe65eaa ac25c473 ac594980 ac617dd4 ac74fa88 acb3cc61 ad22a5a2 ad275580 ad9d7620
adbcd347 ae48a2e9 aedcc29a af34d745 af38b387 af7af152 afd1f9e6 b044f514 b1221e32
b160a14b b22c4317 b2679913 b2c29ea5 b2cf82bc b3388fd1 b3c68199 b3d5d662 b3f4239c
b435ed10 b491923c b4c9482d b4f055af b5ba3f70 b62797bd b6c6ca36 b75bb2d8 b76c7ef9
b7958a56 b7b13f90 b7c2a14e b7e2fd32 b811eae8 b8252de6 b859d184 b8ff0094 b915f3d6
b9480dbe ba0b74c1 ba1876d8 ba2d7752 ba8ebdb7 baa8d98d bb8fb157 bb9cdc70 bbae63d6
bbf5886f bbf846a4 bc021829 bc24b911 bc6189b9 bc66b1b1 bc8928c3 bcec7978 bcf717b3
bcfcfcb8 bd1b6ee5 bd218306 bdc8f553 bdd43f40 bddabaff bdebad46 be213ae0 be35af97
bef24dde bf24a40f bf637687 bf71994b bffe029e c002b368 c02a3cde c02d053b c06e0351
c0af33e7 c0cc92de c1303fe8 c1ec8cc6 c29e2a76 c2f0aaf8 c2fb0478 c33eda4f c340da7f
c3a0add0 c3b6131f c3dc8063 c41d87d4 c4319332 c45c69f0 c46c4d63 c4d06b7c c5cedc6f
c5d5ced6 c5d8a4aa c61c65c2 c6c41654 c6fe8477 c737ff5b c748d941 c7a1f108 c7a4dae5
c84dc681 c89820ce ca0a3e48 ca1d8e27 ca5c7796 cafd53eb cb01532f cb07ad76 cb3a365f
cb610ec0 cb6490b4 cbc108f0 cbfa43bf cc2dd5f3 cc99404d ccb1e474 ccd47b8d cd10cdb6
cd2e0444 cd59c3ef cdb706a7 ce1febb7 ce8c08a2 cec9fd86 cef02202 cefd1a41 cf1f934d
cff521fe d0c0cfcf d0fa5b3e d0fed5c8 d133c8ee d17ed267 d1802ae5 d1d1f80a d1fad54b
d23a4e97 d245eec8 d2812a30 d28c6ee1 d2917e5b d29c14ca d2b983aa d2f53afe d3f93d14
d4206900 d4875c5a d4b0a34d d5112841 d59062e1 d5943674 d598cb0f d6026bce d6101552
d6281e56 d63dda30 d69f73fa d74031e5 d75e80ad d765cf8d d7663570 d7b88003 d7ecfd0c
d8346f68 d88212e1 d899c7ea d8fb776e d9160dce d93a2ac7 d976e562 d9914c79 d9a6cf07
d9b0e38c d9d60ae4 da0802ba da0ef1db da179e02 da7388a8 da779da6 daf95331 db27cee4
db38a4d3 dbb2c456 dbfc7334 dc26862a dc4e26e8 dc680f4d dc79c5f3 dc94a5de dcb6dcea
dcca3983 dcf218d4 dd17686b ddd6b261 df16a4dc df30375e df760a6f e03d3d23 e052d0ad
e065d28c e06fd76a e08789bb e1028e32 e1227e5e e12459c3 e12c57e6 e14cd40d e19427ee
e1b0e03e e1c2810f e1c89ccb e2062b19 e25b57e1 e25f29f2 e25fca7f e2b7dbd3 e2fda3d9
e3394a58 e37dc916 e4265778 e47dbfac e4be8807 e5383838 e543c04a e555f0f8 e5a40290
e6504732 e6945667 e6d53253 e6e1bb1a e70ee2fb e733dd87 e74cb038 e74f89ee e75608ef
e7f0d3aa e84dfac3 e85953c6 e87f284f e896b2bf e8e6a7f5 e91e9aed e95b3ef4 e9ea9c29
ea349d85 eb32e536 eb3c1a33 eb56dfdc ebaefac3 ebcda96c ebcf5ef6 ec078a9d ec1b5c83
ec33b109 ec550471 ec5d902d ecb3180f ecc60d21 ed482d32 ed6d6e9d ed74aaa0 eda3f0bd
ede062c0 ede3ce40 edfb6b60 ee1de380 ee374114 ee75cd81 ee7bc6c2 ee7df6f2 ee90c5d4
eea3c324 ef2b5810 ef732949 ef7525f6 ef805cf0 efd96722 f012c1bc f091155b f0e380ab
f0f3c969 f110f20c f115c9aa f11c1419 f1868de1 f1d8e544 f2870fde f28ac36d f2a810b1
f2c6780c f3922c04 f3e679a1 f3e6b8e6 f4163267 f482d5ac f51a0a2b f548b227 f5ba887f
f608070f f6472730 f69ad57e f6eb2d3c f7dffa95 f7e43603 f7e4da9e f7f0f441 f84ac353
f87545cc f893bb60 f8a597ab f8a75de2 f8f14a87 f914e789 f91ddd6c f987e06e f9a4f0d2
f9c9c1d7 fa1c3c45 fa560c90 fa6f87a1 fa8b73f4 fa8ea142 fa95c176 fa9e7809 fb17fe99
fbe3fe3c fbe81566 fc37ea88 fc69c524 fc6fe82c fc763d66 fc791a31 fcbbd617 fd163fe2
fd1e91d5 fdbce03f fe2e6bbc fe455205 ff1ff9aa ff58ba62 ff871edb}

[root@homeserver ~]# ./restic-beta prune -v 2
repository 5451d26a opened successfully, password is correct
loading indexes...
loading all snapshots...
finding data that is still in use for 41 snapshots
[1:25] 100.00%  41 / 41 snapshots
searching used packs...
collecting packs for deletion and repacking
[0:20] 100.00%  104017 / 104017 packs processed

used:           1379956 blobs / 485.838 GiB
unused:           29570 blobs / 5.736 GiB
total:          1409526 blobs / 491.574 GiB
unused size: 1.17% of total size

to repack:            0 blobs / 0 B
this removes          0 blobs / 0 B
to delete:        11241 blobs / 4.613 GiB
total prune:      11241 blobs / 4.613 GiB
remaining:      1398285 blobs / 486.960 GiB
unused size after prune: 1.123 GiB (0.23% of remaining size)

totally used packs:     102300
partly used packs:         613
unused packs:             1104

to keep:       102913 packs
to repack:          0 packs
to delete:       1104 packs
rebuilding index
[4:30] 100.00%  102913 / 102913 packs processed
deleting obsolete index files
[0:04] 100.00%  61 / 61 files deleted
removing 1104 old packs
[1:15] 100.00%  1104 / 1104 files deleted
done
[root@homeserver ~]# ./restic-beta check
using temporary cache in /tmp/restic-check-cache-511709492
repository 5451d26a opened successfully, password is correct
created new cache in /tmp/restic-check-cache-511709492
create exclusive lock for repository
load indexes
check all packs
check snapshots, trees and blobs
no errors were found

That seemed to fix the issue so I think I'll continue using this beta version
for now. Let me know if I can provide any other information.

@firecat53
Copy link

Well...I ran a restic check --read-data-subset 1/5 and got:

[root@homeserver ~]# restic check --read-data-subset 1/5
using temporary cache in /tmp/restic-check-cache-211109035
repository 5451d26a opened successfully, password is correct
created new cache in /tmp/restic-check-cache-211109035
create exclusive lock for repository
load indexes
check all packs
check snapshots, trees and blobs
read group #1 of 21029 data packs (out of total 102916 packs in 5 groups)
Pack ID does not match, want b4bac5dc, got 6b8955e1
Pack ID does not match, want cd4344dd, got 1724994a
Pack ID does not match, want f07771ac, got cf05d691
Pack ID does not match, want 9b6eb855, got a9d75a53
Pack ID does not match, want 96674bcf, got c55d8d25
Pack ID does not match, want dc6b3e79, got 5d48b806
Pack ID does not match, want 6e58c225, got ec106d6d
[1:30:17] 100.00%  21029 / 21029 packs
Fatal: repository contains errors

Apparently there are still issues :/ Some other reading indicates perhaps an issue with data corruption and B2 backend? How to recover? Feel free to split my comments to a new issue if it's not related to the OP. Thanks!

@ldhieu
Copy link
Author

ldhieu commented Dec 18, 2020

However, your situation is a bit weird. If check --read-data does not find any error, prune should also run. So this seems to me like your backend does not produce stable results to restic which would be a bad situation.

I would be interested in the output of prune --dry-run from the beta builds. (Note the dry run option is only available in the beta builds) - can you try this out?

Sorry @aawsome due to timing constraints I had to delete the corrupted files, re-index and re-run the whole backup process, so I can't provide that --dry-run output anymore

Will look out for it in the future.

@aawsome
Copy link
Contributor

aawsome commented Dec 18, 2020

@firecat53 Thanks for your pruning report. In fact, I wanted to write yesterday that you should run check with --read-data as the new prune does no longer read the pack files and may not detect (and fail due to) some errors the old prune did. (But detecting errors is the job of check 😉)

To recover, you can try

You can manually delete or move them, then run restic rebuild-index followed by a normal backup run. If there was any data needed in those removed packs (and still available in the source to backup) , restic will add it again. Make sure you run a restic check after to check that the backup really added all needed data.

@ldhieu No worries. Hope your repo keeps staying in good shape from now 👍

@MichaelEischer
Copy link
Member

MichaelEischer commented Dec 18, 2020

I really wonder what causes these damaged pack files on B2. B2 is right now the only backend for which restic sends along a SHA1 hash of the pack files during upload (which should rule out file corruption during upload). So either we are seeing lots of failed downloads without any further error indications or something breaks before / during upload.

@firecat53 Can you take a look at the damaged (?) pack files in your B2 bucket? b4bac5dc is for example stored in data/b4/b4bac5dc[...]. Does that file have multiple versions? When downloading a file B2 also returns it's sha1 hash, it would be interesting to manually verify that the downloaded file content matches that hash. Does the B2 user/web interface display that information somewhere? Please also download one or multiple of the pack files and run shasum -a256 <filename> to verify that the pack files are indeed damaged.

@aawsome
Copy link
Contributor

aawsome commented Dec 18, 2020

Another remark: as prune and check do not complain, the file sizes seem to be correct...

@firecat53
Copy link

firecat53 commented Dec 18, 2020

@MichaelEischer:

After my initial post (after the initial restic check --read-data-subset 1/5), I tried what @aawsome suggested and

  • Deleted the pack files (xxxx) listed as Pack ID does not match, want xxxx, got yyyy manually from B2.
  • Ran restic rebuild-index
  • Ran the normal restic backup
  • Ran the normal restic check
    • Received a bunch of the error for tree xxxxx errors
  • Ran my normal restic forget command
  • Ran restic prune
    • Got the same error as we did initally {<data/12065738> <data/16d80012> ..... } not found in the new index Data blobs seem to be missing, aborting prune to prevent further data loss!
  • Ran restic check --read-data-subset 2/5 as described below.
    • Still getting the error for tree xxxx errors
  • Ran restic rebuild-index --no-cache to see if that would help
  • Ran restic check again and am still getting the error for tree xxxx errors.

To answer the specific questions you asked after I ran restic check --read-data-subset 2/5:

error for tree 772545ee:                                                                                                   
  tree 772545ee: file "cover.jpg" blob fa74571c17bc81d52f0b8936485eb4b768c710e1e7d43f371478f9874f802991 not found in index
  tree 772545ee: file "metadata.opf" blob 16d80012ceaf347b5884cae19073b6091fcc273f286d649237ee7233931c4f51 not found in index
....
<several more of the `error for tree xxxxxxxxx` errors>
....
read group #2 of 20745 data packs (out of total 103108 packs in 5 groups)                                                  
Pack ID does not match, want 2e97496a, got 27854e80                                                                        
Pack ID does not match, want 2465c2dc, got 5ded7c4b                                                                        
Pack ID does not match, want 1506e0c6, got f7cbf40c                                                                        
[1:23:41] 100.00%  20745 / 20745 packs                                                                                     
Fatal: repository contains errors

For file data/2e/2e97496ae5b862647eaececc84e3cefe98d04c72ec2f94dcba05ce8e995bc266:

  • There's only one version, but I don't have any versioning or snapshots enabled on B2.
  • The SHA1 hash listed on the B2 site matches sha1sum <filename>
  • The sha256 sum of the downloaded file matches the name of the file
  • I can't find any instance (filename or file content) of 27854e80 in the
    cache or in the data/27/ directory on B2. Maybe that's normal?

For file data/24/2465c2dce8b1dc1f9001b4e45b4272209c7090b6406499908604ca71c748544d

  • SHA1 sum of downloaded file matches B2 listed SHA1 sum
  • SHA256 sum of downloaded file matches the filename.

I hope I answered all of your questions...where to go from here?

Thanks!

Edit: I did notice that all of the error for tree xxxx errors referenced items that were deleted from my server several weeks ago (deleted a large 25+ GB directory).

@aawsome
Copy link
Contributor

aawsome commented Dec 19, 2020

For file data/2e/2e97496ae5b862647eaececc84e3cefe98d04c72ec2f94dcba05ce8e995bc266:

* There's only one version, but I don't have any versioning or snapshots enabled on B2.

* The SHA1 hash listed on the B2 site matches `sha1sum <filename>`

* The sha256 sum of the downloaded file matches the name of the file

* I can't find any instance (filename or file content) of 27854e80 in the
  cache or in the data/27/ directory on B2. Maybe that's normal?

That's normal and as it should be. The problem here is, that your file seems to be all correct, but for some reason restic check does compute a different SHA256 hash than shasum did... 😢

Sorry, but I did not think that this could be possible and therefore my advice was totally misleading. Is there a way that allows you to restore the files you deletet from B2 in the

Deleted the pack files (xxxx) listed as Pack ID does not match, want xxxx, got yyyy manually from B2.

step? Might be that they were if fact all fine..

Before you proceed with steps to repair your repo (or do anything to modify this repo), you should find the reason for this SHA256 mismatch. Honestly, most likely this is due to a hardware error on your PC. Can you

  • give some information about the hardware you are using (especially CPU, RAM)?
  • run shasum multiple times on this file (or all files) to see, if this always produces the same result?
  • rerun the check --read-data several time to see if it produces deterministic results?
  • try the check --read-data on another PC?
  • run some hardware testing like memtest on your PC?

@firecat53
Copy link

Is there a way that allows you to restore the files you deletet from B2

No, there's no versioning enabled.

  • give some information about the hardware you are using (especially CPU, RAM)?

Lenovo TS140 Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz, 8GB ECC RAM. Archlinux on BTRFS RAID 1.

  • run shasum multiple times on this file (or all files) to see, if this always produces the same result?

I was able to do this on one of the files multiple times on both server and
laptop with the same results.

  • rerun the check --read-data several time to see if it produces deterministic results?
  • try the check --read-data on another PC?

Tried restic check --read-data-subset 3/5 on my laptop and got the same set of
error for tree xxxx errors but none of the Pack ID does not match errors.
Although to be fair, this was a different subset.

I've been trying to avoid running check --read-data-subset multiple times just cause
it's costing money on B2 🙄

  • run some hardware testing like memtest on your PC?

Ran Lenovo memory checkers (about 3 hours) and memtest86+ (for about 20 min)
with no errors. BTRFS volumes are scrubbed weekly with no errors and short/long smartctl
tests are run daily/weekly, also with no errors.

I had a suspicion that these errors were all related to the large directory
deletion I did (25+ GB) on 11/26, so I deleted all my snapshots from that time
and earlier. Yeah, deleting five months of snapshots may have been somewhat
risky, but I do have local backups going back 6 months so I'm not too concerned.

After this, I was able to run a restic prune with no errors, followed by
restic check --read-data-subset 1/5 on my laptop and a restic check on both
laptop and server with no errors.

I'm afraid my fix may have prevented further troubleshooting to narrow down the issue and for that I'm sorry!!

TL;DR - no obvious hardware issues found. Suspect something happened during a
large directory deletion. Removed all snapshots from that time back and all is
well.

@MichaelEischer
Copy link
Member

MichaelEischer commented Dec 23, 2020

@firecat53 The backup format doesn't really have the concept of deleted files. I'd rather expect that adding lots of new data could lead to some damaged files (simply because there are more files which makes it more likely that something goes wrong).

Which linux kernel version do you use? We recently had a issue with pack files which randomly failed the integrity check, which seems to have been caused by a buggy kernel version: https://forum.restic.net/t/troubleshooting-unreproducible-consistency-errors/3372/16

[Edit]As you're using archlinux you're kernel version is probably already much newer than 5.5?[/Edit]

@JPPhoto
Copy link

JPPhoto commented Jan 1, 2021

I'm running restic 0.11.0 on Windows 10 20H2 with a REST backend and got a similar error message when trying to prune after removing a number of old snapshots on my 12TiB backup:

...
find data that is still in use for 192 snapshots
[43:00:26] 100.00%  192 / 192 snapshots
Fatal: [<data/646827e1> <data/da50cbe1> <data/7aa023ab> <data/4016966d> <data/a8b17e2e> <data/ae39f37d> <data/1c7f8046> <data/1aff2452> <data/aeccbf74> <data/36bb177f>] not found in the new index
Data blobs seem to be missing, aborting prune to prevent further data loss!

I'm running check now and it also reports problems with missing data blobs.

@MichaelEischer
Copy link
Member

@JPPhoto Please open a separate issue and add a (redacted) snippet of the check output there.

I'm closing this issue as the two originally reported repository corruptions have been resolved and there's nothing left to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: need feedback waiting for feedback, e.g. from the submitter
Projects
None yet
Development

No branches or pull requests

5 participants