File retention & automatic deletion - Does not work

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud 31.0.8 (Docker)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • Docker built-in package
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Nginx
  • PHP version (e.g, 8.3):
    • Docker built-in package
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • When I’ve tried to enable and use that feature (few days ago)
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Official docker container
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • It’s not related to the problem at all (server background processes)

Summary of the issue you are facing:

I have installed the Retention app Version 2.0.1 (last available) and trying to set-up the auto-deletion of files. I created the tags (made them invisible like it said on wiki) and made the retention configuration

After I added those tags to few files and folders (the example is on the screenshot)
How you can see the file was created and modified more than 2 weeks ago

But after a day or so it was not deleted

I’ve managed to find few topics with the same problem (ex Automatic file deletion (Retention) is not working - #3 by scubamuc ) but it’s not the same problem because my background jobs are working fine

Steps to replicate it (hint: details matter!):

  1. Download the app

  2. Create tags and retention configuration

  3. Add tags to the files

  4. Wait (nothing happens)

Log entries

Nextcloud

Sorry. I don’t know what kind of logs I have to provide here because it just is not working when it should

Configuration

Nextcloud

occ config:list system output


{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_REAL_IP"
        ],
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.7.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "loglevel": 2,
        "default_phone_region": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [
            "files_reader",
            "files_ebookreader",
            "epubreader",
            "epubviewer"
        ],
        "theme": ""
    }
}

Apps

Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_accesscontrol: 2.0.0
  - files_automatedtagging: 2.0.0
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_retention: 2.0.1
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - groupfolders: 19.1.2
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_ldap: 1.22.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - circles: 31.0.0 (installed 23.1.0)
  - dashboard: 7.11.0 (installed 7.3.0)
  - encryption: 2.19.0
  - epubreader: 1.4.7 (installed 1.4.7)
  - epubviewer: 1.8.0 (installed 1.8.0)
  - files_external: 1.23.0
  - files_reader: 1.5.3 (installed 1.5.3)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - smb_test: 0.3.11 (installed 0.3.11)
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0

Hey @SiriusGale a “gusty” welcome to the Nextcloud community :waving_hand:

that app didn’t work for me either. that’s why I took the bash route, which works for the snap and for bare-metal installs. maybe this is a possible solution ALL files retention - is it possible ? - #2 by scubamuc for you too, but I guess the AIO folks will give you better advice.

Hey @scubamuc
Thank you for the answer!
I’ve checked out your “workaround” and it will definitely work.
If we didn’t manage to fix that bug this is the way how I’m going to set up the auto-deletion.
But still it would be great to have an opportunity to manage the file retention and auto-deletion in interface (how it was supposed)

Hey @SiriusGale, no problem, glad I could help…

be patient, there are some really clever folks here who will get you sorted :sunny:

I will get back to this topic in 3 days.
I have set 5-days tag (auto-delete after 5 days) for some folders 2 days back… Nextcloud AIO.
So be patient.

1 Like