Persistent "missing chunk" error

I decided to separate a snapshot-id (which already had several revisions) into two, representing two subsets of the same repository.

As I didn’t mind keeping the old revisions, but I didn’t want to upload again, I decided to:

  1. delete the old snapshot folder on storage
  2. perform a backup with the new snapshot 1
  3. perform a backup with the new snapshot 2
  4. run a prune -exaustive -exclusive to delete the old chunks

But in the end, I got the “missing chunks” error:

2. backup 1:

INFO BACKUP_STATS Total running time: 00:06:40
WARN BACKUP_SKIPPED 2 files were not included due to access errors

In fact there were two open files, but check didn’t report anything wrong:

INFO SNAPSHOT_CHECK All chunks referenced by snapshot [new-snapshot-1] at revision 1 exist

3. backup 2:

INFO BACKUP_STATS Total running time: 00:22:02
WARN BACKUP_SKIPPED 6 files were not included due to access errors

check:

INFO SNAPSHOT_CHECK All chunks referenced by snapshot [new-snapshot-2] at revision 1 exist
FATAL DOWNLOAD_CHUNK Chunk f4580......14b017 can't be found

4. prune:

TRACE BACKBLAZE_CALL [0] URL request 'HEAD https://f001.backblazeb2.com/file/......14b017' returned status code 404
FATAL DOWNLOAD_CHUNK Chunk f4580......14b017 can't be found

I made sure the files were closed and ran the backup again, which ended without the “access errors” warnings, but the check and the prune continue to report the error.

In fact, the mentioned chunk is not in storage.

I removed the new created snapshot folders and executed the steps above again, with the same result. (and mentioning the same chunk!)

Any ideas?

Remove the cache directory .duplicacy/cache and try again. I suspect somehow the cache has a copy of a snapshot file that is different from the one in the storage (which can happen if you reuse snapshot ids).

It worked! I removed the entire repositories folder and the check and prune worked.

But I wasn’t reusing snapshot ids, the two new ones are completely different from the old one. :thinking: