Prune does not delete snapshots

Please describe what you are doing to trigger the bug:
I run duplicacy.exe prune -id laptop -keep 365:365 -keep 30:90 -keep 7:10 -keep 1:2 -threads 64

Please describe what you expect to happen (but doesn’t):
Delete old snapshot according to the criteria.

Please describe what actually happens (the wrong behaviour):
It writes a long list of Deleting snapshot laptop at revision 1038. But when I run the command again it writes the same output. Also when I run the list command, it still shows these revisions.

What is the storage backend?

When duplicacy says “deleting snapshots” it does not actually delete then at that time; it puts them to the list to delete in the end; the better message would have been “collecting snapshot”. If then actual deletion process fails — the snapshots will remain.

I have seen such failures with google drive if the account is shared with another account in any way but admin.

The storage backend is b2, and pruning worked fine in the past.
I just noticed that the prune command finishes with Chunk 207ec450361dc466ffa210b1d1d71ce0a3e9cae0f6863514323cef5aa5b05419 does not exist in the storage. Which is not indicated as an error, but I guess it is?
How do I recover from this error?

I’ll follow the advice here: Fix missing chunks

No, don’t.

I think what happened was one of previous prunes was interrupted, after it deleted chunks but before it deleted snapshots. Now those snapshots are missing chunks, but in reality they should have been deleted and not exist in the first place. Repairing them makes no sense — they will be pruned again anyway. This bug has been reported many times and solutions were suggested (e.g. here). It has not been fixed yet.

I would run check with persist, take a note of failed snapshots, delete them manually from storage (see snapshots folder, sub folder named after a name of a snapshot I’d) and then clean orphans by running prune with -exhaustive flag.

1 Like

added a feature request for it: Feature Request: -persist flag for 'prune' that deletes snapshots no matter if there are missing chunks