Blobs to B2 repo do not get deleted, ever

So, for some reason, deleting snapshots down to a bare minimum do nothing to restore free space in the bucket. I have Kopia running as a container backing up my Unraid system to Backblaze. I have a secondary backup container carrying out similar duties (Duplicati) which performs as expected to trim unwanted snapshots.

The first round of snapshot deletions was a few days ago. After a full 24 hours, nothing seemed to be deleted. So, I forced a safe full maintenance with

kopia maintenance run --full --safety=none

The maintenance ran without any error and several GBs in unreferenced blobs were deleted.
After a couple days, space was never freed up in the bucket. So, I deleted more snapshots this evening and followed it with a full maintenance run with safety turned off an hour later. Still, nothing deleted at the bucket.

I came across a similar thread where it was indicated the kopia.maintanace file was corrupted, so after searching in the config and cache folders, I can’t seem to locate it which is strange, considering there are no maintenance errors.

Any other things to look for?
I’ve read on Reddit the following:

Check out “Lifecycle Settings” of your B2 bucket. By default it keeps all the versions of all the files, even if “SYNC” Transfer Mode instructs to delete them. Switching to "Keep Only Last Version " should do the trick.

However, this sounds dangerous - can anyone confirm this is the right approach for Kopia?

EDIT: After further digging, it appears my docker container’s hostname has changed to a different 12 character string (same user root). Not sure why or when this occurred, so a different hostname is “owner”. Could this explain it? Still, no errors or complaints running maintenance with the new hostname. Should I set to the owner to the new hostname?

Not sure what you mean by dangerous. It is your decision. If you want to keep every deleted or changed file forever it is fine but your space usage will only grow.

It has nothing to do with kopia - it is your storage settings.

And if you want to keep old files versions then at least make it useful for kopia and configure object lock protection for your data.

Ok thanks for the tips - I have changed retention at the bucket to “Keep only the last version”. But, I don’t think it will be possible for Kopia to instruct all the unreferenced blobs in the bucket to be deleted now, as bucket deletions are possible only from the moment the bucket retention policy has been changed. Would that be correct?

I will consider your recommendation to enable object lock to strike a balance between space and protection.

They are not simply “unreferenced”:slight_smile: they are not visible at all. In normal mode kopia does not see your B2 storage versions.

Look at B2 settings - there should be option to delete old versions there. Or you can do this from command line using b2 cli.

And always you can start fresh and delete all bucket.