"restic prune" returns stacktrace

I’m also having memory issues when running “restic check” or “restic prune” on a virtual Ubuntu 16.04 standard virtual machine with 4GB memory and 1GB swap. Some details on the repo:

[4:19] 545420 directories, 2661668 files, 830.173 GiB
restic disk usage: 551G # happy deduplication!
105 snapshots # why I want to run prune!

When I run restic check with GOGC=20, I get the following error:

check snapshots, trees and blobs
fatal error: runtime: out of memory

When I run restic prune with GOGC=80, I get the following error:

find data that is still in use for 105 snapshots
EOF
ReadFull(<data/4de420d135>)
github.com/restic/restic/internal/restic.ReadAt
        /tmp/restic-build-354782844/src/github.com /restic/restic/ 
        internal/restic /readerat.go:41
...
main.main
        src/github.com/restic/restic/cmd/restic/main.go:69
runtime.main
        /usr/local/go/src/runtime/proc.go:198
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:2361

I can increase swap on my SSD in an exponential search (2,4,8,…128 GB)

Could anyone offer more suggestions?

Thanks!

You need to set GOGC, not GOCG.

Thanks very much. My typo was in my post, not in my code. I did set GOGC to 80, and it did switch behavior from the “fatal error” to “ReadFull”.

I also just increased swap to 40G, but it both was not used, and did not remove the “ReadFull” error.

My next ideas are to try restic 0.8.3 (I’m using 0.8.2 now), and to compile restic from scratch.

@crkrenn can you post the full stack trace? This looks odd…

Here are my restic output and the stack trace:

Fri Apr 13 22:55:35 PDT 2018
counting files in repo
building new index for repo
[10:51] 100.00%  118414 / 118414 packs

incomplete pack file (will be removed): 039a87e5232561ef02d28b3c503dc17bfdd2d50c3c48c904def2acc87062f391
incomplete pack file (will be removed): 053898d6360fdc05d6c47004afc6b35f27e81083db1a41aef5cbfe9598be18bd
incomplete pack file (will be removed): 09bef3be2952ad583465bc7d9c823343beca651716bbdfab09f425e7acf7805b
incomplete pack file (will be removed): 0a0558fc6b0bef156dfdddd3da8c36f0d88dc20cbc57ab541c72f4c51aa4894b
incomplete pack file (will be removed): 0b82046c627279e502d2513d11089c7c63303c767db7653da2af75a88b183d63
incomplete pack file (will be removed): 0c8a0b2cf1b182d21c2865756e8c37188724bc97c5f644443ec7ce7f6e847636
incomplete pack file (will be removed): 141bc2fe10b9ec697eb805793ae6358e2d6c8bac9c418a78575338154e6ac444
incomplete pack file (will be removed): 187ce03914fe3fff844d56a466072ebfb5f358809c14ca5979b0775976ea5055
incomplete pack file (will be removed): 1955494989c0ad065390902d42e5fbe0feab0b8e4cdc3c2047b9015df5ebf330
incomplete pack file (will be removed): 24d71c4c0e953ba1a1b66dc9977e528e4d699d759604f29c1098d60d844d1a76
incomplete pack file (will be removed): 296e263f7a69d51b16fd3bc3855d9b05234abb6189a0913ad3cfdf023b5e2ada
incomplete pack file (will be removed): 2c519fe664c18760141c7757875f69c0bb4fd52d26aca89e6773afac40e86aad
incomplete pack file (will be removed): 2e156d28d06d8745523cd0ef267a04fa2b6a4bcf25f5373712f9039fae017594
incomplete pack file (will be removed): 2f80a9ac96434930d5e45f017e647c2f79dde87fb3f50c4a41ad8a4d33e31369
incomplete pack file (will be removed): 3068bd167d8ddec519aa431328bac9031fb67fb44927fedb03d7b9fde31d0f02
incomplete pack file (will be removed): 33d5a1d298ff8936971efd1b92f758bbfb628fbaf20eb67668d17a8280d8a91b
incomplete pack file (will be removed): 341b88e16b2f60fc6a483b951456d73ed576641c0ebfa77c75b5d9e094505cfb
incomplete pack file (will be removed): 3bfbbd367f867f58b7607673be160c9f5915d7eaf6ab6eafd0af5a862e8b3010
incomplete pack file (will be removed): 3f1133800f41dfcbb738519cfb0d7e00dd5f321624cfc1671d2ab90f3d4d2dc9
incomplete pack file (will be removed): 3fb4c44f4055e5073f9f1c430fb58dcf2be79ab1de4a719136f94ed525d73b2b
incomplete pack file (will be removed): 4216e0c524f4067c256a19f222e86c1da7e02289d736e6d53f8857167ce6a6b6
incomplete pack file (will be removed): 43582525fddbbef38e68ed0c0021a7870d842ff830899d080157abb4479ba8b1
incomplete pack file (will be removed): 45cc6d131fc9c5a1f6cb42521e23a6566acdc2855a27b3157738c104f3140f3a
incomplete pack file (will be removed): 4de420d135c555b4a7c26fb8316258b26b5aed0e3491e8250fb23ff58a8a5d04
incomplete pack file (will be removed): 56a96c029e7bd02a7d2c0c0a11be4fb46e7fb842fc6df1df3582af0953b61f5c
incomplete pack file (will be removed): 58adb4ae155646082cfd787004f65c20fcb74743c2a7d2f387522d15d6b75f93
incomplete pack file (will be removed): 5bb56eda3564c094fde783bb35511e9caa9d2222c557e9a17ff7eecc06a95798
incomplete pack file (will be removed): 6168ea81b023a6975e1429d5cae30fedbb3584c739118d566b3c7aa1737f058b
incomplete pack file (will be removed): 62696846a9151845616764726a229c18d06cc262b2b22731dd9ec07b60c04e7e
incomplete pack file (will be removed): 66b8f9d640d63c5abb9480eebe7d6ab501e673204af4cab89feb900df0b1786b
incomplete pack file (will be removed): 6d742e837c51369142a706ecd1bfc5e40ad78654b39589cc225f25e9e3edb859
incomplete pack file (will be removed): 6d89a96c23e8c8a9711f49131e72cfedc450fa57c0a0973246e6c013ac9e3fd9
incomplete pack file (will be removed): 6e25e603af0ecbcbcc0bffcf1f239aff9127f95fd9a1fbaf7a1909daa1f5ad3f
incomplete pack file (will be removed): 74c4bab6c400d4fa29c950714fb25478587a06ab7cdf3d9e47a01abdd9979b33
incomplete pack file (will be removed): 796901cd6279a0ee976b6b43c3d5a55cc34ae5d6b921bf8950b7cadd4421b5f8
incomplete pack file (will be removed): 8067d4b62db01810ccbf1926878d9d137b88d0f1b193d85b5d71f3a02aa8c578
incomplete pack file (will be removed): 80d63518871db3851049a8c802d6db3cf6bd188763e7eb029d380367ceaa4a83
incomplete pack file (will be removed): 8297d167674e4c8d9584fb8797d764be00ca95743b88ef964f56f07017d2efdb
incomplete pack file (will be removed): 82e477ce4bcc45e748364364d64cb140befb9cdefefcc44f54387451ac928c8f
incomplete pack file (will be removed): 9322f5ac751e8aff965edb799b379c80254b1946a187d55bd4f3f5f914dc3356
incomplete pack file (will be removed): 94f3361e449985594b0ec4cb3c23774519c1d54e250442b480629207817a82fb
incomplete pack file (will be removed): 9837b351e70854f610078d4443743f97f5b656797141bbdf7828200cef89bf15
incomplete pack file (will be removed): 9b2ec09a98afd31df03b4f309c48d8be6c6e02b9bbb4d6ebbf4d73dee40785c1
incomplete pack file (will be removed): 9c5ab65de1ee1a53e1588693c130c5ad745172d3f213c3b00c4bc1217b906f66
incomplete pack file (will be removed): a906cccf4fcc83387893d491ea02575744c514d70b359ef688dc9eb0c1ab0567
incomplete pack file (will be removed): ad530a58cc827b6c5f4c3d2530ed952f4089ebfbb63bbf57340ab75aba75191f
incomplete pack file (will be removed): b2092b79376a2cb940dc4a9dca542f447c13f9cd81a644d1bf7068926f316c1f
incomplete pack file (will be removed): b696399b2c51b9073fc2af22b02e8ed17f865e1812b58268ebd85888b119aba2
incomplete pack file (will be removed): b71402803ac8b18854c8e9f8bab5808fcd19018febe7e832e34fed9a64279e43
incomplete pack file (will be removed): bbe4293d3f207277f7f01bdf0f1d11099099d4d1023ddbb18f2f3ab1f5d35f60
incomplete pack file (will be removed): c8b6149fa0eae085b1f46126ba32bb1ce0187a71353da6cde76820950a8009e6
incomplete pack file (will be removed): d45eeff594e82e43cddce60ffbfccd95a416ddfbc6a7506032def9e61cab372d
incomplete pack file (will be removed): d512cf7bb9b8e984ce25504fc6044e1739bb8de0318f5a7722b7eeeb0e03a3d1
incomplete pack file (will be removed): d62aed684554b502f904fac21fbe15e4d3b8117ae33cf53ed3e6f916a886e42b
incomplete pack file (will be removed): d96e038805e69ec2328c93c3bb15cabd1ef47095fd3b586a79b61fbaa90499b8
incomplete pack file (will be removed): db9e9812fd8d08fa5a587714c7d2655a6df9896bc4e41fbc9eaf41d969efcab7
incomplete pack file (will be removed): dbed1e5042e53fff710b15f28134a91e451bd615ff0d646e2351eaefee0a73bc
incomplete pack file (will be removed): e4b5812679979281f5d2b01f5307eb413c2f1df5cc8421fd258ed275fc35109b
incomplete pack file (will be removed): e69638232c91bd52aaf80cfe6fa9f0a33b5285e7d2e85d5ea0050d70fd838c18
incomplete pack file (will be removed): ed2a3e047b9d27042f9b3962755a6305851f6b214b585c6d2dc648fbd3413111
incomplete pack file (will be removed): eddb31b1a1d2057222ef27a17492999ef2c92db0f5bdc1afa37837519a5d6891
repository contains 118353 packs (2657580 blobs) with 553.151 GiB
processed 2657580 blobs: 18887 duplicate blobs, 1.188 GiB duplicate
load all snapshots
find data that is still in use for 107 snapshots
EOF
ReadFull(<data/4de420d135>)
github-com/restic/restic/internal/restic.ReadAt
	/tmp/restic-build-354782844/src/github-com/restic/restic/internal/restic/readerat.go:41
github-com/restic/restic/internal/repository.(*Repository).loadBlob
	/tmp/restic-build-354782844/src/github-com/restic/restic/internal/repository/repository.go:144
github-com/restic/restic/internal/repository.(*Repository).LoadTree
	/tmp/restic-build-354782844/src/github-com/restic/restic/internal/repository/repository.go:621
github-com/restic/restic/internal/restic.FindUsedBlobs
	/tmp/restic-build-354782844/src/github-com/restic/restic/internal/restic/find.go:11
github-com/restic/restic/internal/restic.FindUsedBlobs
	/tmp/restic-build-354782844/src/github-com/restic/restic/internal/restic/find.go:31
github-com/restic/restic/internal/restic.FindUsedBlobs
	/tmp/restic-build-354782844/src/github-com/restic/restic/internal/restic/find.go:31
github-com/restic/restic/internal/restic.FindUsedBlobs
	/tmp/restic-build-354782844/src/github-com/restic/restic/internal/restic/find.go:31
main.pruneRepository
	src/github-com/restic/restic/cmd/restic/cmd_prune.go:191
main.runPrune
	src/github-com/restic/restic/cmd/restic/cmd_prune.go:85
main.glob..func16
	src/github-com/restic/restic/cmd/restic/cmd_prune.go:25
github-com/restic/restic/vendor/github-com/spf13/cobra.(*Command).execute
	/tmp/restic-build-354782844/src/github-com/restic/restic/vendor/github-com/spf13/cobra/command.go:698
github-com/restic/restic/vendor/github-com/spf13/cobra.(*Command).ExecuteC
	/tmp/restic-build-354782844/src/github-com/restic/restic/vendor/github-com/spf13/cobra/command.go:783
github-com/restic/restic/vendor/github-com/spf13/cobra.(*Command).Execute
	/tmp/restic-build-354782844/src/github-com/restic/restic/vendor/github-com/spf13/cobra/command.go:736
main.main
	src/github-com/restic/restic/cmd/restic/main.go:69
runtime.main
	/usr/local/go/src/runtime/proc.go:198
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:2361
Fri Apr 13 23:15:45 PDT 2018

Hm, very interesting! This is not a memory issue. I think you found a corner case which the code does not handle yet.

Can you please have a look at the file whose name starts with 4de420d135 in the data/4d subdir? Is that file empty? Can you please run sha256sum on it?

Which backend are you using?

Hello Alexander (@fd0),

Here is some info on the file you asked for. It is not empty.

root@ubuntu-backuppc:/nfs/homes/restic/data/4d# ls -lt 4de420d135*
-rw------- 1 root root 2949120 Mar 14 17:31 4de420d135c555b4a7c26fb8316258b26b5aed0e3491e8250fb23ff58a8a5d04

root@ubuntu-backuppc:/nfs/homes/restic/data/4d# du -sh 4de420d135*
2.9M	4de420d135c555b4a7c26fb8316258b26b5aed0e3491e8250fb23ff58a8a5d04

root@ubuntu-backuppc:/nfs/homes/restic/data/4d# sha256sum 4de420d135*
7141ed767cc6a0c75aad5f07f21086fd052db5c08fbd30366b81c1a0b2341155  4de420d135c555b4a7c26fb8316258b26b5aed0e3491e8250fb23ff58a8a5d04

Most of the data in my repo was generated from an OSX laptop with the following command:

sudo restic  -p ~/bin/restic.pass -r sftp:admin@192.168.2.2:/share/CACHEDEV1_DATA/homes/restic/  backup -x /Volumes/Macintosh_HD/*  >> ~/restic-log/log

Would using rest-server in the future be better?

And, I’d like to repair the repo if possible, as I’ve already spend many days pushing it to AWS.

Gratefully,

-Chris

PS. Before I started working with restic, I had tried backuppc, and I could never get it to work backing up a 800G mac laptop.

Ok, what happens here is that somehow the transfer of the file in question was interrupted and/or aborted without restic noticing, and the file is truncated. During prune, restic first recognizes that the file is invalid:

incomplete pack file (will be removed): 4de420d135c5[...]

But then it tries to load data from the end of the file, which isn’t there:

EOF
ReadFull(<data/4de420d135>)

And the code does not handle this failure case well, so you see a stack trace.

You can see that the file is broken because the file name does not equal the SHA-256 hash of the contents:

root@ubuntu-backuppc:/nfs/homes/restic/data/4d# sha256sum 4de420d135*
7141ed767cc6a[...]  4de420d135[...]

Congratulations, you’ve found a bug. On the downside: Your repo is missing data and I don’t have any idea how that happened :frowning:

I’ll try to reproduce the situation locally so that I can push a fix so you can run prune again…

Once I’ve fixed the bug and you can run prune again, most of the repo can be used just fine. Once you remove the snapshot which references the data that isn’t there, the repo will be without errors again. No need to push the data again, but maybe it’s a good idea to run restic check --read-data afterwards to make sure there aren’t any other truncated files…

1 Like

I’ve created an issue to track it here: https://github.com/restic/restic/issues/1727 and I’ve split out this topic from the (more general) topic about memory consumption :slight_smile:

For now you can try moving the file from the repo to somwhere else and running prune again. But maybe first run restic check --read-data to see how many other truncated files are there (and how much data stored in these files is still referenced).

Alexander,

Thank you very much for figuring this out.

I think that problem is that my wife and kids use the laptop regularly, I am scheduling an hourly backup from the laptop, and the the laptop is regularly put to sleep. So, I probably increased my likelihood of hitting this bug.

Is there a chance that pushing the data from the laptop to rest-serve instead of directly to the repo via sftp would either remove or reduce the probability of this bug happening again?

And, I’m also happy to run via sftp for another week or so to see if your fix works in the wild.

Sincerely and gratefully,

Chris

Ps. Please take time with your family and friends, and consider how you can delegate tasks to the Restic community. I don’t know much go, but I do have OS X, Ubuntu, and have compiled Restic on Ubuntu.

1 Like

I’d also be willing to help fix this, especially if it can be reproduced. (I’m following the issue on GitHub.)

I have a feeling it might have to do with restic’s error checking or retry logic with regards to HTTP errors? Anyway, I don’t know, but worth looking into.

Hello Matt,

I’m making a copy of the damaged repo for future testing. I will run “ restic check --read-data” next.

I will also see if I can recreate the bug using a smaller repo.

Thanks!

Thank you again. I am working the problem this weekend.

Is there a chance that pushing the data from the laptop to rest-serve instead of directly to the repo via sftp would either remove or reduce the probability of this bug happening again?

If there is a greater than epsilon chance that it will, I would like to try it.

If your transfer costs are high, you should wait for Alexander’s advice before continuing, but: I have always found HTTPS to be faster and more reliable than SFTP, so, I dunno; if I was you, I’d try using rest-server if there’s little or no cost to you. Re-attempting the backup certainly shouldn’t hurt your repository.

Matt, Thank you for your advice. My current plan is to 1) finish duplicating the repo, 2) run restic check --read-data, 3) delete any damaged files, 4) try prune again. Then, given that you find https to be faster and more reliable, I’ll set up rest-serve and give it a try.

Ok, I’ve started running “restic check --read-data” with 512 unreferenced packs and > 115 “tree errors” so far (see below). When “restic check --read-data” is done, I will plan to remove the truncated files, then run “restic check (without --read-data)” and “restic prune”.

Does this seem reasonable?

Will any missing data in the repo be replaced the next time I run a backup?

I will also save the “restic check --read-data” log file and can confirm how much data stored in the truncated files was still referenced.

partial log below:

restic@ubuntu-backuppc:~/log$ grep -e "not referenced" restic.check.read.data.log | wc
    512    3584   50688

restic@ubuntu-backuppc:~/log$ grep -e "error for tree" restic.check.read.data.log | wc
    115     460    2875

restic@ubuntu-backuppc:~/log$ grep -e 638c23837cba4d5c3f1f62ec96f41cee251ec3a48568ea0280da3fa98cb1951d -e 8782d054 -e 24d71c4c0e *read*log

pack 638c23837cba4d5c3f1f62ec96f41cee251ec3a48568ea0280da3fa98cb1951d: not referenced in any index
error for tree 8782d054:
  ReadFull(<data/24d71c4c0e>): EOF

restic@ubuntu-backuppc:~/log$ grep -e "not referenced" restic.check.read.data.log | wc
    512    3584   50688

restic@ubuntu-backuppc:~/log$ grep -e "error for tree" restic.check.read.data.log | wc
    115     460    2875


storage ID f37b267d
load indexes
check all packs
pack 638c23837cba4d5c3f1f62ec96f41cee251ec3a48568ea0280da3fa98cb1951d: not referenced in any index
pack bbb2ba7355b04de303a2352f89174731194134950eb833c21a7407bbacc35fbe: not referenced in any index
pack f839786e464ac0e8d7a3a73874ea92e778f9a806646bffaf6fe0e89ca36b9729: not referenced in any index
...
check snapshots, trees and blobs
error for tree f7820509:
  ReadFull(<data/24d71c4c0e>): EOF
error for tree 44b1172e:
  ReadFull(<data/9837b351e7>): EOF
error for tree 9cc3ebb4:
  ReadFull(<data/4de420d135>): EOF
error for tree b9c4ab51:
  ReadFull(<data/4de420d135>): EOF
error for tree 82dda40f:
  ReadFull(<data/4de420d135>): EOF

Some updates: 1) I made a copy of the repo; 2) I ran restic check and removed 3 truncated files, but 3) restic check; restic rebuild-index; restic prune does not work with either 0.8.2 or 0.8.3.

Could longer logs or running with debug be helpful?

Could running “restic backup” again or restic from the “prune-agressive” branch be helpful?

Gratefully,

-Chris

restic check:

load indexes
check all packs
pack 52bc7418d...: not referenced in any index
pack 8067d4b62...: not referenced in any index
...
pack 2968ceba8...: not referenced in any index
pack 118fefb892...: not referenced in any index
pack 2334bc7c4...: not referenced in any index
pack 24d71c4c0...: does not exist
pack 9837b351e...: does not exist
pack 4de420d13...: does not exist
check snapshots, trees and blobs
Tue Apr 24 22:12:09 PDT 2018

restic rebuild-index:

Sun Apr 29 08:20:56 PDT 2018
counting files in repo
[11:55] 100.00%  121839 / 121839 packs

finding old index files
saved new indexes as [a270eaf6 4e3e0e01 1fd82b99 2a569f6c a73c42b2 8e9d90f3 7888e2b8 06b42ee8 f4841954 ca430f63 5b1079ac bc107d69 86ab4
279 01dfd00b bb592cd1 eb98af0a 932db14f c7c5352e 51cc36f8 c935c9f0 ed1c42da ca9b6b78 04982b42 66edb561 f9893a15 9d4a13fc 06a5f743 e28f0
87d ced4085f 095ee8d8 cd721caa a5f2ac3d b569beda 0e8f9e87 1250f5d9 1c7811b1 981e025f 305065c6 dc547d10 9a251e4f 03abded5]
remove 41 old index files
Sun Apr 29 08:37:15 PDT 2018

restic prune:

Sun Apr 29 08:37:15 PDT 2018
counting files in repo
building new index for repo
[5:31] 100.00%  121839 / 121839 packs

incomplete pack file (will be removed): 039a87e...
incomplete pack file (will be removed): 0409c3e...
incomplete pack file (will be removed): 045a9fd...
...
incomplete pack file (will be removed): fe7d4476b...
repository contains 121745 packs (2716576 blobs) with 568.842 GiB
processed 2716576 blobs: 20563 duplicate blobs, 1.369 GiB duplicate
load all snapshots
find data that is still in use for 126 snapshots
tree d66450e99bf65fdc0d248a57d772109ed77b2b8544b5d5f53392106dad187d02 not found in repository
github.com/restic/restic/internal/repository.(*Repository).LoadTree
        /tmp/restic-build-413028034/src/github.com/restic/restic/internal/repository/repository.go:620
github.com/restic/restic/internal/restic.FindUsedBlobs
        /tmp/restic-build-413028034/src/github.com/restic/restic/internal/restic/find.go:11
github.com/restic/restic/internal/restic.FindUsedBlobs
        /tmp/restic-build-413028034/src/github.com/restic/restic/internal/restic/find.go:31
github.com/restic/restic/internal/restic.FindUsedBlobs
        /tmp/restic-build-413028034/src/github.com/restic/restic/internal/restic/find.go:31
github.com/restic/restic/internal/restic.FindUsedBlobs
        /tmp/restic-build-413028034/src/github.com/restic/restic/internal/restic/find.go:31
github.com/restic/restic/internal/restic.FindUsedBlobs
        /tmp/restic-build-413028034/src/github.com/restic/restic/internal/restic/find.go:31
main.pruneRepository
        src/github.com/restic/restic/cmd/restic/cmd_prune.go:191
main.runPrune
        src/github.com/restic/restic/cmd/restic/cmd_prune.go:85
main.glob..func17
        src/github.com/restic/restic/cmd/restic/cmd_prune.go:25
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).execute
        /tmp/restic-build-413028034/src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:698
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).ExecuteC
        /tmp/restic-build-413028034/src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:783
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).Execute
        /tmp/restic-build-413028034/src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:736
main.main
        src/github.com/restic/restic/cmd/restic/main.go:69
runtime.main
        /usr/local/go/src/runtime/proc.go:198
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:2361
Sun Apr 29 08:50:43 PDT 2018

Below is a bash script (block #2) that I think will reproduce an important part of the error that I have been struggling with. It makes a backup of an old Debian distribution (~200 MB). It chooses three data blobs at random and truncates them. Then it runs restic check, prune, rebuild-index, etc.

After the last “restic prune”, I get the following error (block #1). Should I open an issue in “https://github.com/restic/restic/issues/new”?

Thanks!

++ sudo restic -r /nfs/homes/multi-restic/test5 prune -p /home/restic/bin/restic.password
password is correct
found 2 old cache directories in /home/restic/.cache/restic, pass --cleanup-cache to remove them
counting files in repo
building new index for repo
[0:01] 100.00%  57 / 57 packs
incomplete pack file (will be removed): 45e7772eb4f8fbfa898b3530faa1cb085caa6a174e0bb1bbcf239fcc12d248b9
incomplete pack file (will be removed): bf662792ff4268e13436a6a3e05efce232cc44c9eb11171e2071c16e33150eff
incomplete pack file (will be removed): d27d3897276343972476ba1c7cfdfca6c4e7e195f6ef5313d803168f5df7549c
repository contains 54 packs (1359 blobs) with 218.844 MiB
processed 1359 blobs: 0 duplicate blobs, 0B duplicate
load all snapshots
find data that is still in use for 3 snapshots
[0:00] 100.00%  3 / 3 snapshots
Fatal: number of used blobs is larger than number of available blobs!
Please report this error (along with the output of the 'prune' run) at
https://github.com/restic/restic/issues/new


#!/bin/bash
set -x

sudo /bin/rm -rf /nfs/homes/multi-restic/test5

sudo restic -r /nfs/homes/multi-restic/test5 init -p ~/bin/restic.password

sudo du -sh /nfs/homes/temp-iso/debian
sudo restic -r /nfs/homes/multi-restic/test5 backup -p ~/bin/restic.password /nfs/homes/temp-iso/debian

sudo touch /nfs/homes/temp-iso/debian/READ*
sudo date >> /nfs/homes/temp-iso/debian/date-log
sudo restic -r /nfs/homes/multi-restic/test5 backup -p ~/bin/restic.password /nfs/homes/temp-iso/debian

# sort (GNU coreutils) 8.25 gives a new random file each time
sudo bash -c 'find /nfs/homes/multi-restic/test5 -size +4M -print | sort -R | head -1 | parallel "echo {}; wc {}; du -sh {}; truncate -s 1307252 {}"'
sudo bash -c 'find /nfs/homes/multi-restic/test5 -size +4M -print | sort -R | head -1 | parallel "echo {}; wc {}; du -sh {}; truncate -s 2307252 {}"'
sudo bash -c 'find /nfs/homes/multi-restic/test5 -size +4M -print | sort -R | head -1 | parallel "echo {}; wc {}; du -sh {}; truncate -s 3307252 {}"'

sudo restic -r /nfs/homes/multi-restic/test5 check -p ~/bin/restic.password

sudo restic -r /nfs/homes/multi-restic/test5 check --read-data -p ~/bin/restic.password

sudo restic -r /nfs/homes/multi-restic/test5 rebuild-index -p ~/bin/restic.password

sudo restic -r /nfs/homes/multi-restic/test5 prune -p ~/bin/restic.password

sudo restic -r /nfs/homes/multi-restic/test5 backup -p ~/bin/restic.password /nfs/homes/temp-iso/debian

sudo restic -r /nfs/homes/multi-restic/test5 check --read-data -p ~/bin/restic.password

sudo restic -r /nfs/homes/multi-restic/test5 rebuild-index -p ~/bin/restic.password

sudo restic -r /nfs/homes/multi-restic/test5 prune -p ~/bin/restic.password

set -x
1 Like

All:

Looking at the logs more carefully, it seems that restic 0.8.3 did recover from three truncated blobs. I’m running the same sequence of commands on my larger repo to see if that will fix the problem.

Sincerely,

-Chris