nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.67k stars 4k forks source link

[Bug]: Versions expiration not working #47272

Closed kubrickfr closed 1 week ago

kubrickfr commented 3 weeks ago

⚠️ This issue respects the following points: ⚠️

Bug description

I waited for the fix to #45707 to land before opening this bug report, because I thought it was somewhat similar. But now I'm on 29.0.5 RC1 and I still have some version expiration issues.

Steps to reproduce

  1. Create a diagram with the drawio app.
  2. Work on it for a bit, this creates a file with lots of revisions.
  3. All the versions stay forever.

Expected behavior

According to https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/file_versioning.html, old versions should be deleted.

image

Installation method

Community Docker image

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 28.0.1 to 28.0.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.xxxxx.net"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.5.0",
        "overwrite.cli.url": "https:\/\/nextcloud.xxxxx.net",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_REAL_IP"
        ],
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "theme": "",
        "loglevel": 2,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "preview_max_memory": -1,
        "enabledPreviewProviders": [
            "OC\\Preview\\HEIC",
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\Krita",
            "OC\\Preview\\Movie"
        ],
        "maintenance_window_start": 1,
        "updater.release.channel": "stable",
        "maintenance": false,
        "allow_local_remote_servers": true,
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-aarch64-glibc",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-aarch64",
        "memories.vod.ffmpeg": "\/usr\/local\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/local\/bin\/ffprobe",
        "memories.gis_type": 1,
        "memories.vod.disable": false,
        "upgrade.disable-web": true
    }
}

List of activated Apps

Enabled:
  - activity: 2.21.1
  - cloud_federation_api: 1.12.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - drawio: 3.0.2
  - encryption: 2.17.0
  - end_to_end_encryption: 1.15.2
  - facerecognition: 0.9.51
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.1
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - memories: 7.3.1
  - nextcloud_announcements: 1.18.0
  - notifications: 2.17.0
  - oauth2: 1.17.0
  - oidc: 0.9.2
  - password_policy: 1.19.0
  - photos: 2.5.0
  - previewgenerator: 5.6.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recognize: 7.1.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - richdocuments: 8.4.4
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - support: 1.12.0
  - survey_client: 1.17.0
  - text: 3.10.1
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_webauthn: 1.4.0
  - updatenotification: 1.19.1
  - viewer: 2.3.0
  - workflowengine: 2.11.0
Disabled:
  - admin_audit: 1.19.0
  - bruteforcesettings: 2.9.0
  - circles: 29.0.0-dev (installed 28.0.0)
  - comments: 1.19.0 (installed 1.18.0)
  - contactsinteraction: 1.10.0 (installed 1.9.0)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - suspicious_login: 7.0.0
  - systemtags: 1.19.0 (installed 1.18.0)
  - twofactor_totp: 11.0.0-dev (installed 10.0.0-beta.2)
  - user_ldap: 1.20.0
  - user_status: 1.9.0 (installed 1.8.1)
  - weather_status: 1.9.0 (installed 1.8.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

huge

Additional info

No response

kesselb commented 3 weeks ago

Cronjob running, any warnings in your setup overview, something in the logs?

kubrickfr commented 3 weeks ago

Cronjob running occ maintenance:repair --include-expensive doesn't fix the mime type issue (unrelated?) image Nothing specials in the logs image

kesselb commented 3 weeks ago

What happens if you run the expire command manually?

occ versions:expire

kubrickfr commented 3 weeks ago

Nothing, it says it's scheduled to run automatically

kesselb commented 3 weeks ago

cc @artonge @icewind1991

kubrickfr commented 1 week ago

The problem persists.

I would like to add that even if I deacivate the bacground job with occ config:app:set --value=no files_versions background_job_expire_versions as suggested in the documentation, launching ./occ versions:expire manually still results in Auto expiration is configured - expiration will be handled automatically according to the expiration patterns...

kubrickfr commented 1 week ago

From what I understand from the code, the background job or the expire command are not involved at all in delting the version according to the automatic schedule, it only deletes files that have expired if the admin has changed the versions_retention_obligation setting.

"Normal expiration" is supposed to happen when a new version is created, it is then scheduled to abide by the rules, and I confirm that this works as expected (it's even written in the documentation "The versions are adjusted along this pattern every time a new version is created.").