Files remains in B2 Backblaze after removing it in Nextcloud

Nextcloud version (eg, 20.0.5): 22.2.0
Operating system and version (eg, Ubuntu 20.04): Debian 10.10
Apache or nginx version (eg, Apache 2.4.25): 2.4.48
PHP version (eg, 7.4): 7.4 and 8.0

The issue you are facing:

I’m using B2 Backblaze connected to Nextcloud through External Storage, I can upload files perfectly, but if I remove files from Nexcloud, those aren’t removed from Backblaze bucket too. I also used php occ files:scan --all, but it’s doing nothing.

The output of your Nextcloud log in Admin > Logging:

No errors.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocm93vhx6rwe',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'cloud.domain.com',
  ),
  'datadirectory' => '/home/admin/web/cloud.domain.com/public_html/data',
  'dbtype' => 'mysql',
  'version' => '22.2.0.2',
  'overwrite.cli.url' => 'https://link',
  'dbname' => 'admin_cloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'admin_cloud',
  'dbpassword' => 'xxxx%$ev#xxxxx',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

Nothing interesting here, no errors.

Hi @demlasjr

I think that’s normal and has nothing to do with Nextcloud. Backblaze keeps old versions of files per default. If you delete a file in Nextcloud it gets “hidden” in you bucket, respective the direct file / download link gets removed in the WebUI of Backblaze and you could still access all versions by clicking on the number in the brackets.

2021-10-17_15-36

You can change how many versions and how long Backbabaze should keep your files in the Lifecycle Settings of your bucket.

https://www.backblaze.com/b2/docs/lifecycle_rules.html

Hi @bb77,

I also set in Backblaze bucket settings to keep only the last version of the file, but the file remains there for days. Shouldn’t it be deleted after 24 hours? I want it to get deleted from Backblaze B2 when it’s getting deleted for Nextcloud. I’m doing something wrong?

Thanks for the answer.

Kind regards.

Hi @bb77,

I also set in Backblaze bucket settings to keep only the last version of the file, but the file remains there for days. Shouldn’t it be deleted after 24 hours? I want it to get deleted from Backblaze B2 when it’s getting deleted for Nextcloud. I’m doing something wrong?

Thanks for the answer.

Kind regards.

According to their documentation, it should… At least as far as I understand it.

Keep only the latest version of the file deletes previous versions of a file one day after uploading a new version or hiding the file.

https://www.backblaze.com/b2/docs/lifecycle_rules.html

But I have never tested this myself though. I don’t use Backblaze myself as an external storage for Nextcloud…

Thanks for the answer @bb77,

I guess Backblaze isn’t the right B2 cloud to use, since there is no option to do it, at least not with Nexcloud.
I used B2 a lot for servers backup and had no issues, however, this thing isn’t working well.

I have this:
screenshot-tree-ams5-0000.backblaze.com-2021.10.18-16_53_53

As you can see, there is an old and a new version of the photo, none of them where deleted even after 24 hours even if I set hiding to null and delete after 1 day. At least, there always will remain a copy of the file and that’s awful for such a type of service, since after time, there will be a lot of garbage using space. I know that the removal it’s happening “the next day”, but I just uploaded a file and deleted it and there is no “hidden” file for it.
Thanks anyway.