Restic check returns error, how to fix

When running ‘restic check’ I get the following message:

error for tree 62f954e8:
  tree 62f954e8: file "00000011": metadata size (79627158) and sum of blob sizes (79654599) do not match
Fatal: repository contains errors

How does one go about correcting an issue like this?

Have you tried running restic rebuild-index and restic prune?

This is a very uncommon error: It means that stat() returned 79.627.158 byte for the file, but the sum of all bytes restic read from the file is 79.654.599 (so it grew a bit).

Usually, restic should then update the size field to match the actual size, I don’t know what happened here.

You can ignore the error: When you restore the file, restic will write the correct size (of the data is has from the file) into the restored file.

Do you know which version of restic you used to create the snapshot?

1 Like

Could this happen if the file is appended to after stat()ing but before the read finishes?

I’m not sure, but for the new archiver this won’t happen any more :wink:

1 Like

Sorry, but I’m not sure which version of Restic was used to created the snapshot.

Is there a way to determine which snapshot is causing this error, so that I can forget / prune it and make the error go away?

so it says 62f954e8

could u run to check what snapshots

    restic -r /path/toyourrep snapshots

then post the outcome something like this

         ID        Date                 Host        Tags        Directory
 1aa3e35f  2018-05-05 15:30:49  prometheus              /media/smb2
75f3588e  2018-05-05 15:34:14  prometheus              /media/smb2
225e7b6d  2018-05-05 15:36:30  prometheus              /media/smb2

Thanks for the suggestion, but I pruned a bunch of snapshots and the issue went away.