"Fatal: repository contains errors" after "--check-unused"

Dear friends,
I use the parameter --max-unused 0 for my call restic forget --prune. The next call restic check shows me: “no errors were found”. That is good, but the call restic check --check-unused shows me a lot of lines like “unused blob <data / 43f4fe6c>” and ends with “Fatal: repository contains errors”. Calling “restic rebuild-index” does not help. Why do “unused blobs” exist despite --max-unused 0? Thanks for your help.

Forgot to say: I’m using restic “0.12.0”

Rolf

An addendum: If I replace

restic forget --prune --max-unused 0

by

restic prune --max-unused 0

this means that there are no more “unused blobs”. So the problem is solved. But I think that restic forget --prune should also take parameters like --max-unused 0 into account.

forget --prune only runs prune if the forget command actually did remove snapshots.

In general, unused blobs in a repository are not a problem, they’ll just waste a bit of space. Hence, I’d recommend to just run a plain check without --check-unused.

forget --prune only runs prune if the forget command actually did remove snapshots.

Yes. And prune ignores the --max-unused parameter. That seems like a mistake to me.

In general, unused blobs in a repository are not a problem, they’ll just waste a bit of space.
Hence, I’d recommend to just run a plain check without --check-unused.

I don’t like this waste a bit of space!

I had some confusion with that “fatal” error lately, too. I think it’d be better to say something like "123 unused blobs found. This is totally normal. If you want to get rid of those, call restic prune --max-unused 0" or something like that.

Yes, the “fatal error” seems problematic. But that is not my problem here. “restic forget --prune” is a combination of “restic forget” and “restic prune”. The question is: why does the --prune part ignore prune-specific parameters?

1 Like

forget --prune --max-unused 0 ... works perfectly fine for me. The important part here is that prune is only run if forget has actually removed snapshots. That is if no snapshots were removed then prune does not run and therefore all prune options are ignored. If this doesn’t solve the problem for you, please provide the log output of restic.