Failed to decrypt the chunk

I have recently ran into a problem copying my storage offsite to Backblaze B2. I get the following error:

2022-03-23 16:27:05.620 DEBUG SNAPSHOT_COPY Copying chunk ff8478838f848f93ceb64ca830e9bf96360621fdb90a21d9074e8443761dfb72 to a4079e2cd698e6a40bc091b9471a0e623db6e2b9dd0060feb5cc0dde41a5b97f
2022-03-23 16:27:05.620 DEBUG DOWNLOAD_FETCH Fetching chunk ff8478838f848f93ceb64ca830e9bf96360621fdb90a21d9074e8443761dfb72
2022-03-23 16:27:05.723 WARN DOWNLOAD_RETRY Failed to decrypt the chunk ff8478838f848f93ceb64ca830e9bf96360621fdb90a21d9074e8443761dfb72: cipher: message authentication failed; retrying
2022-03-23 16:27:05.745 WARN DOWNLOAD_RETRY Failed to decrypt the chunk ff8478838f848f93ceb64ca830e9bf96360621fdb90a21d9074e8443761dfb72: cipher: message authentication failed; retrying
2022-03-23 16:27:05.767 WARN DOWNLOAD_RETRY Failed to decrypt the chunk ff8478838f848f93ceb64ca830e9bf96360621fdb90a21d9074e8443761dfb72: cipher: message authentication failed; retrying
2022-03-23 16:27:05.789 ERROR DOWNLOAD_DECRYPT Failed to decrypt the chunk ff8478838f848f93ceb64ca830e9bf96360621fdb90a21d9074e8443761dfb72: cipher: message authentication failed
Failed to decrypt the chunk ff8478838f848f93ceb64ca830e9bf96360621fdb90a21d9074e8443761dfb72: cipher: message authentication failed

I have ran a check with -chunks on both storages and both report that all chunks have been successfully verified.
I may have made things worse by deleting the snapshot file that I suspected was the problem. I’m also having trouble finding that chunk anywhere in either storage.
I don’t mind losing this particular snapshot if that’s the simplest solution. I just need things back in working order.
Any guidance here would be a huge help.

You can delete the .duplicacy/cache/storage/verified_chunks file and run a check with -chunks. This file stores the list of chunks that have already been verified before and Duplicacy would skip them by default.

Running on the source storage completed successfully, so it seems to be fine. However, running it on the destination storage, I got this

Chunk 4d0a8a910e9b6b2227815b69cff2ea5301d21f0b7d74dd6e161f9c44f10d301b can't be found

So I assume that means I have some issues on the destination storage (Backblaze B2). What is the correct path to fix this?

I guess this was probably a red herring as it seems that my B2 download cap exceeded. Since my local storage seems to be intact, perhaps the simplest solution would be to delete the B2 storage and then recopy it?

Guessing the missing chunk on the destination is a metadata chunk which previous snapshots reference, and the new backup also relies on. Either way, you can force it to upload the missing chunk if you hide the snapshot revisions, so it treats the next backup as new.

I’d rename the snapshot folder on the destination to snapshot.old then do another copy. It should enumerate the list of chunks before finding out what’s missing and it should re-upload only the missing chunk(s), skipping the rest.

After the copy, you should have a working snapshot folder and can delete the old one. (Or, you can rename the old one back if you happen to have a different prune retention period and a bunch of older snapshots.)

I’m still struggling with this issue. I have created an entirely new bucket on Backblaze B2 and did a copy to that. After several days it threw the same error. So I think this tells me that the issue is on the local storage. I’m still not 100% sure how to locate and remove the offending snapshot/chunk.

I was able to use the list command to find all snapshots of the bad chunk:

duplicacy list -a -storage <storage> -chunks > chunks.txt

I could then search for the chunk in that file and see which snapshots have it.

1 Like