Missing packs not found 😱

I have a repo which when I restic check it yields the following (besides some unreferenced packs):

pack 1e790c45: does not exist
pack 867b890f: does not exist

In order to find what referenced them, I ran restic find --pack 1e790c45 and restic find --pack 867b890f, which to my surprise didn’t yield anything relevant at all - the following is the complete output:

enter password for repository:
repository baa72e57 opened successfully, password is correct

Yep, nothing else. I believe I have previously used the find --pack command successfully on other repositories, so I think it should indeed find something.

Any thoughts on this, is this expected to happen in some cases? If so, what case could possibly make restic check tell me it’s missing a couple of packs, and then not be able to tell me what referenced those packs? Perhaps I’m missing something obvious here.

The end goal I’d like to reach is to forget and prune the snapshots that are affected by these packs missing, but I’m not sure how to do that now :slight_smile:

restic 0.9.6 (v0.9.6-104-g58bd1652) compiled with go1.13.5 on linux/amd64

Could this perhaps happen if you forgot some snapshots, but didn’t yet prune, such that there are indexes referencing the (non-existent) packs (which makes restic report the packs as missing when traversing the indexes), but there’s no snapshot referencing those indexes (which makes restic not report any snapshots for the queried packs)?

restic find --pack id tries to look up the actual pack, but if the packs are missing then it won’t find anything. The reason why no error message is printed is, that the code currently drops the error message :frowning: . Just modify cmd_find.go such that it reads as follows (the if is currently missing):

		err := f.packsToBlobs(ctx, f.pat.pattern)
		if err != nil {
			return err
		}

I don’t think that there’s currently a ready-to-use command that tells which blobs exist in a pack according to the index. Most commands assume that the index is correct and that listed blobs actually exist, this does even apply to the check command. The latter just sanity checks whether all packs listed in the index exist. Only check --read-data will actually check all packs.

As the index is damaged (or rather does not correctly represent the repository), the only way forward is to rebuild the index. Then restic stats --mode blobs-per-file will complain about the snapshots with missing data.

3 Likes

Right, this explains it. Thanks a lot!