Unresolved "pack f8c6065a: not referenced in any index" error

This happens often. Last time it did I could fix it with a rebuild-index. Here is output from my run of this command just now on the relevant repository -

tomc@tomc-Galago-Pro:~/bkup$ restic -p /home/tomc/Dropbox/ssap -r /media/tomc/seagate-4-b/sys76-backup/bk-hid3a rebuild-index
repository 02047da4 opened successfully, password is correct
loading indexes...
getting pack files to read...
adding pack file to index 5290ca1f01eca0a13c6588813b9c288298fb3c666646718081973bdc0515df22
adding pack file to index 030ba8658ea002a590f6bc42ba8b5e3b51d542c3b30cdc246422bb5e55d00aab
adding pack file to index f8c6065abf11fad6721ffc39942cc2100d25c40941cc16e750849e5d85bc7f27
adding pack file to index 252092b3eef1856720c4e815affcae8a03b9eda98dbc09beff37a4fb69f69371
adding pack file to index ec9af993ed69ed5b5f01dd71d35ef2ae58813cbadcb36e35b8590095e27ca68a
reading pack files
[0:00] 100.00%  5 / 5 packs
rebuilding index
[0:00] 99.94%  8890 / 8895 packs processed
deleting obsolete index files
[0:00] 100.00%  3 / 3 files deleted
done
tomc@tomc-Galago-Pro:~/bkup$

It appears to have worked, yet here is the output from my immediately subsequent run of a prune and error-check AFTER the rebuild-index.

here is script I ran:

date --rfc-3339=seconds
restic -p /home/tomc/Dropbox/ssap forget --prune --keep-monthly 3 --keep-weekly 4 --keep-daily 6 -r /media/tomc/seagate-4-b/sys76-backup/bk-hid3a
date --rfc-3339=seconds
restic -p /home/tomc/Dropbox/ssap -r /media/tomc/seagate-4-b/sys76-backup/bk-hid3a check --read-data
date --rfc-3339=seconds

It’s output:

tomc@tomc-Galago-Pro:~/programs/restic-backup/restic-backup-scripts$ sh backup-error-correction
2021-12-16 20:52:28-08:00
repository 02047da4 opened successfully, password is correct
Applying Policy: keep 6 daily, 4 weekly, 3 monthly snapshots
keep 1 snapshots:
ID        Time                 Host        Tags        Reasons           Paths
-------------------------------------------------------------------------------------------
e981bec4  2021-12-11 17:05:36  sys76                   daily snapshot    /home/tomc/.local
                                                       weekly snapshot   /home/tomc/.recoll
                                                       monthly snapshot
-------------------------------------------------------------------------------------------
1 snapshots

keep 2 snapshots:
ID        Time                 Host             Tags        Reasons           Paths
------------------------------------------------------------------------------------------------
cd54adfb  2021-12-14 13:57:50  tomc-Galago-Pro              daily snapshot    /home/tomc/.local
                                                                              /home/tomc/.recoll

22efaa12  2021-12-15 09:33:31  tomc-Galago-Pro              daily snapshot    /home/tomc/.local
                                                            weekly snapshot   /home/tomc/.recoll
                                                            monthly snapshot
------------------------------------------------------------------------------------------------
2 snapshots

2021-12-16 20:52:29-08:00
using temporary cache in /tmp/restic-check-cache-576963278
repository 02047da4 opened successfully, password is correct
created new cache in /tmp/restic-check-cache-576963278
create exclusive lock for repository
load indexes
check all packs
pack f8c6065a: not referenced in any index
pack 030ba865: not referenced in any index
pack 252092b3: not referenced in any index
pack 5290ca1f: not referenced in any index
pack ec9af993: not referenced in any index
5 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  1 / 3 snapshots
[0:02] 100.00%  3 / 3 snapshots
  signal interrupt received, cleaning up

tomc@tomc-Galago-Pro:~/programs/restic-backup/restic-backup-scripts$

Note the line “You can run restic prune to correct this.” I can advise that this NEVER fixed the problem. I wish this erroneous advice would be removed!

So, what is my next move, to get this repository OK so I can run my backup duplication script?

Prune, by default, allows some unused data to be left in the repository (should be %5). So what you’re seeing might be these leftovers actually. Those won’t cause any harm (except from occupying some space of course). If you don’t want that, I can suggest running prune with more restrictive --max-unused parameter :eyes:

Well, yes. If my theory is correct, this message could be a bit more clear.

This should certainly not be accurate :slight_smile: If check tells you pack <ID>: not referenced in any index and you then run prune successfully, then prune will remove those unreferenced pack (assuming of course that the pack(s) are indeed still unreferenced, and hence unneeded, after prune rebuilt the index as part of its processing).

In the case you showed output for above, the reason that your unreferenced packs are not removed is that the forget command did not find any snapshots to remove (you can see that there is no line with remove <X> snapshots in the output), and for that reason it does not run the prune command - it only does so when there are actually any snapshots that were forgotten.

The repository is perfectly fine, assuming that your check --read-data command succeeds without complaining. There’s nothing broken. But if you want to get rid of the unreferenced packs you can run the prune command manually, it should remove them.

Thank you. Helpful! (and reassuring).

Very good, and helpful. Thank you very much…

Your first sentence is correct. I always have up to 5% unused data. However, this never shows up as unreferenced packs.

Oh, right :+1: Thanks.