Server: Trash-bin ignores trashbin_retention_obligation

Created on 26 Aug 2018  路  11Comments  路  Source: nextcloud/server

Steps to reproduce

My config.php:

...
  'trashbin_retention_obligation' => '7, auto',
  'versions_retention_obligation' => '7, auto',
...
  1. Delete some file when you have quota usage > 50%
  2. Check trash bin - it is there
  3. Wait for cron job finished
  4. Check trash bin - file is not there
  5. Check logs and see: Info | files_trashbin | remove "SOME.FILE" (282640B) to meet the limit of trash bin size (50% of available quota)

Expected behaviour

Trash bin keep files even if quota exceed regarding "trashbin_retention_obligation" setting.

Actual behaviour

Trash bin ignores "trashbin_retention_obligation" and use only "auto" mode

Server configuration

Operating system: Ubuntu 16.04

Web server: Apache 2.4.34

Database: MySQL 5.7.23

PHP version: 7.0.30

Nextcloud version: 14.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Updated from older

Where did you install Nextcloud from: Official

Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.

List of activated apps:



Enabled:
  - activity: 2.6.1
  - bruteforcesettings: 1.1.0
  - calendar: 1.6.1
  - checksum: 0.4.0
  - comments: 1.3.0
  - data_request: 1.0.1
  - dav: 1.4.7
  - deck: 0.4.1
  - federatedfilesharing: 1.3.1
  - files: 1.8.0
  - files_external: 1.4.1
  - files_external_dropbox: 1.0.0
  - files_pdfviewer: 1.2.1
  - files_sharing: 1.5.0
  - files_texteditor: 2.5.1
  - files_trashbin: 1.3.0
  - files_versions: 1.6.0
  - files_videoplayer: 1.2.0
  - firstrunwizard: 2.2.1
  - flowupload: 0.0.7
  - gallery: 18.0.0
  - gpxpod: 2.2.2
  - logreader: 2.0.0
  - lookup_server_connector: 1.1.0
  - mail: 0.8.3
  - nextcloud_announcements: 1.2.0
  - notes: 2.4.0
  - notifications: 2.1.2
  - oauth2: 1.1.1
  - ocdownloader: 1.5.6
  - password_policy: 1.3.0
  - polls: 0.8.1
  - previewgenerator: 1.1.0
  - provisioning_api: 1.3.0
  - radio: 0.6.1
  - serverinfo: 1.3.0
  - sharebymail: 1.3.0
  - spreed: 3.2.5
  - survey_client: 1.1.0
  - theming: 1.4.5
  - twofactor_backupcodes: 1.2.3
  - twofactor_totp: 1.4.1
  - unsplash: 1.1.1
  - updatenotification: 1.3.0
  - user_usage_report: 1.0.1
  - weather: 1.5.1
  - workflowengine: 1.3.0
Disabled:
  - admin_audit
  - contacts
  - encryption
  - external
  - federation
  - keeweb
  - systemtags
  - user_external
  - user_ldap

Nextcloud configuration:


Config report

    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "1",
            "2",
            "3"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/1\/nextcloud",
        "dbtype": "mysql",
        "version": "13.0.5.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "filesystem_check_changes": 0,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": "",
        "loglevel": 1,
        "trashbin_retention_obligation": "7,auto",
        "versions_retention_obligation": "7,auto",
        "data-fingerprint": "7be51475e95ea13b254cd880319d98ec",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "preview_max_x": 1080,
        "preview_max_y": 1920,
        "auth.bruteforce.protection.enabled": true
    },
    "apps": {
        "activity": {
            "enabled": "yes",
            "installed_version": "2.6.1",
            "notify_email_calendar": "0",
            "notify_email_calendar_event": "0",
            "notify_email_calendar_todo": "0",
            "notify_email_comments": "0",
            "notify_email_favorite": "0",
            "notify_email_file_changed": "0",
            "notify_email_file_created": "0",
            "notify_email_file_deleted": "0",
            "notify_email_file_restored": "0",
            "notify_email_public_links": "0",
            "notify_email_remote_share": "0",
            "notify_email_shared": "0",
            "notify_setting_batchtime": "3600",
            "notify_setting_self": "1",
            "notify_setting_selfemail": "0",
            "notify_stream_calendar": "1",
            "notify_stream_calendar_event": "1",
            "notify_stream_calendar_todo": "1",
            "notify_stream_comments": "1",
            "notify_stream_favorite": "0",
            "notify_stream_file_changed": "1",
            "notify_stream_file_created": "1",
            "notify_stream_file_deleted": "1",
            "notify_stream_file_favorite": "0",
            "notify_stream_file_restored": "1",
            "notify_stream_public_links": "1",
            "notify_stream_remote_share": "1",
            "notify_stream_shared": "1",
            "types": "filesystem"
        },
        "admin_audit": {
            "enabled": "no",
            "installed_version": "1.3.0",
            "types": "logging"
        },
        "backgroundjob": {
            "lastjob": "11"
        },
        "bruteForce": {
            "whitelist_2": "192.168.0.1\/24"
        },
        "bruteforcesettings": {
            "enabled": "yes",
            "installed_version": "1.1.0",
            "types": ""
        },
        "calendar": {
            "enabled": "yes",
            "installed_version": "1.6.1",
            "types": ""
        },
        "checksum": {
            "enabled": "yes",
            "installed_version": "0.4.0",
            "types": "filesystem"
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "logging"
        },
        "contacts": {
            "enabled": "no",
            "installed_version": "2.1.5",
            "types": ""
        },
        "core": {
            "backgroundjobs_mode": "cron",
            "installed.bundles": "[\"CoreBundle\"]",
            "installedat": "1500300149.3827",
            "lastcron": "1535281213",
            "lastupdateResult": "[]",
            "lastupdatedat": "1535240712",
            "moveavatarsdone": "yes",
            "oc.integritycheck.checker": "[]",
            "previewsCleanedUp": "1",
            "public_files": "files_sharing\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "scss.variables": "91728caa5d548aeb0dc4f40750565c08",
            "shareapi_default_expire_date": "yes",
            "shareapi_expire_after_n_days": "30",
            "umgmt_send_email": "false",
            "umgmt_show_backend": "false",
            "umgmt_show_email": "false",
            "umgmt_show_last_login": "true",
            "umgmt_show_storage_location": "false",
            "updater.secret.created": "1532501168",
            "vendor": "nextcloud"
        },
        "data_request": {
            "enabled": "yes",
            "installed_version": "1.0.1",
            "types": ""
        },
        "dav": {
            "buildCalendarSearchIndex": "yes",
            "enabled": "yes",
            "installed_version": "1.4.7",
            "types": "filesystem"
        },
        "deck": {
            "enabled": "yes",
            "installed_version": "0.4.1",
            "types": ""
        },
        "external": {
            "enabled": "no",
            "installed_version": "3.0.3",
            "max_site": "4",
            "sites": "{\"2\":{\"icon\":\"external.png\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"id\":2,\"name\":\"Cacti\",\"url\":\"https:\\\/\\\/1\\\/cacti_q1w2e3r4t5\\\/graph_view.php\"},\"3\":{\"icon\":\"external.png\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"id\":3,\"name\":\"Webmin\",\"url\":\"https:\\\/\\\/1:5000\"}}",
            "types": ""
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "1.3.1",
            "types": ""
        },
        "federation": {
            "enabled": "no",
            "installed_version": "1.2.0",
            "types": "authentication"
        },
        "files": {
            "cronjob_scan_files": "500",
            "default_quota": "10 GB",
            "enabled": "yes",
            "installed_version": "1.8.0",
            "types": "filesystem"
        },
        "files_clipboard": {
            "enabled": "no",
            "installed_version": "0.7.1",
            "types": ""
        },
        "files_external": {
            "allow_user_mounting": "no",
            "enabled": "yes",
            "installed_version": "1.4.1",
            "ocsid": "166048",
            "types": "filesystem",
            "user_mounting_backends": "ftp,dav,owncloud,sftp,amazons3,dropbox,googledrive,swift,files_external_dropbox,\\OC\\Files\\Storage\\SFTP_Key"
        },
        "files_external_dropbox": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": "filesystem"
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "1.2.1",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "filesystem"
        },
        "files_texteditor": {
            "enabled": "yes",
            "installed_version": "2.5.1",
            "types": ""
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "filesystem"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.6.0",
            "types": "filesystem"
        },
        "files_videoplayer": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": ""
        },
        "firstrunwizard": {
            "enabled": "yes",
            "installed_version": "2.2.1",
            "types": "logging"
        },
        "flowupload": {
            "enabled": "yes",
            "installed_version": "0.0.7",
            "types": ""
        },
        "gallery": {
            "enabled": "yes",
            "installed_version": "18.0.0",
            "types": ""
        },
        "gpxpod": {
            "enabled": "yes",
            "installed_version": "2.2.2",
            "types": ""
        },
        "keeweb": {
            "enabled": "no",
            "installed_version": "0.4.0",
            "types": ""
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "2.0.0",
            "levels": "01111",
            "ocsid": "170871",
            "relativedates": "1",
            "types": ""
        },
        "lookup_server_connector": {
            "enabled": "yes",
            "installed_version": "1.1.0",
            "types": "authentication"
        },
        "mail": {
            "enabled": "[\"family\"]",
            "installed_version": "0.8.3",
            "types": ""
        },
        "nextcloud_announcements": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "pub_date": "Sat, 10 Dec 2016 00:00:00 +0100",
            "types": "logging"
        },
        "notes": {
            "enabled": "yes",
            "installed_version": "2.4.0",
            "ocsid": "174554",
            "types": ""
        },
        "notifications": {
            "enabled": "yes",
            "installed_version": "2.1.2",
            "types": "logging"
        },
        "oauth2": {
            "enabled": "yes",
            "installed_version": "1.1.1",
            "types": "authentication"
        },
        "ocdownloader": {
            "enabled": "yes",
            "installed_version": "1.5.6",
            "types": ""
        },
        "password_policy": {
            "enabled": "yes",
            "enforceHaveIBeenPwned": "1",
            "enforceUpperLowerCase": "0",
            "installed_version": "1.3.0",
            "minLength": "10",
            "types": ""
        },
        "polls": {
            "enabled": "yes",
            "installed_version": "0.8.1",
            "types": ""
        },
        "previewgenerator": {
            "enabled": "yes",
            "installed_version": "1.1.0",
            "types": "filesystem"
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "prevent_group_restriction"
        },
        "radio": {
            "enabled": "yes",
            "installed_version": "0.6.1",
            "types": ""
        },
        "richdocuments": {
            "enabled": "no",
            "installed_version": "1.12.39",
            "types": "prevent_group_restriction"
        },
        "serverinfo": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": ""
        },
        "sharebymail": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "sendpasswordmail": "no",
            "types": "filesystem"
        },
        "sharepoint": {
            "enabled": "no",
            "installed_version": "1.0.2",
            "types": "filesystem"
        },
        "spreed": {
            "enabled": "yes",
            "installed_version": "3.2.5",
            "stun_servers": "[\"stun.nextcloud.com:443\"]",
            "types": "prevent_group_restriction"
        },
        "survey_client": {
            "enabled": "yes",
            "encryption": "no",
            "installed_version": "1.1.0",
            "last_report": "{\"id\":\"ocejdr8m7tcu\",\"items\":[[\"server\",\"version\",\"13.0.5.2\"],[\"server\",\"code\",\"other\"],[\"server\",\"enable_avatars\",\"yes\"],[\"server\",\"enable_previews\",\"yes\"],[\"server\",\"memcache.local\",\"\\\\OC\\\\Memcache\\\\APCu\"],[\"server\",\"memcache.distributed\",\"none\"],[\"server\",\"asset-pipeline.enabled\",\"no\"],[\"server\",\"filelocking.enabled\",\"yes\"],[\"server\",\"memcache.locking\",\"none\"],[\"server\",\"debug\",\"no\"],[\"server\",\"cron\",\"cron\"],[\"php\",\"version\",\"7.0.30\"],[\"php\",\"memory_limit\",-1],[\"php\",\"max_execution_time\",0],[\"php\",\"upload_max_filesize\",2097152],[\"database\",\"type\",\"mysql\"],[\"database\",\"version\",\"5.7.23\"],[\"database\",\"size\",232161280],[\"apps\",\"activity\",\"2.6.1\"],[\"apps\",\"admin_audit\",\"1.3.0\"],[\"apps\",\"bruteforcesettings\",\"1.1.0\"],[\"apps\",\"calendar\",\"1.6.1\"],[\"apps\",\"checksum\",\"0.4.0\"],[\"apps\",\"comments\",\"1.3.0\"],[\"apps\",\"contacts\",\"disabled\"],[\"apps\",\"data_request\",\"1.0.1\"],[\"apps\",\"dav\",\"1.4.7\"],[\"apps\",\"deck\",\"0.4.1\"],[\"apps\",\"external\",\"disabled\"],[\"apps\",\"federatedfilesharing\",\"1.3.1\"],[\"apps\",\"federation\",\"disabled\"],[\"apps\",\"files\",\"1.8.0\"],[\"apps\",\"files_clipboard\",\"disabled\"],[\"apps\",\"files_external\",\"1.4.1\"],[\"apps\",\"files_external_dropbox\",\"1.0.0\"],[\"apps\",\"files_pdfviewer\",\"1.2.1\"],[\"apps\",\"files_sharing\",\"1.5.0\"],[\"apps\",\"files_texteditor\",\"2.5.1\"],[\"apps\",\"files_trashbin\",\"1.3.0\"],[\"apps\",\"files_versions\",\"1.6.0\"],[\"apps\",\"files_videoplayer\",\"1.2.0\"],[\"apps\",\"firstrunwizard\",\"2.2.1\"],[\"apps\",\"flowupload\",\"0.0.7\"],[\"apps\",\"gallery\",\"18.0.0\"],[\"apps\",\"gpxpod\",\"2.2.2\"],[\"apps\",\"keeweb\",\"disabled\"],[\"apps\",\"logreader\",\"2.0.0\"],[\"apps\",\"lookup_server_connector\",\"1.1.0\"],[\"apps\",\"mail\",\"0.8.3\"],[\"apps\",\"nextcloud_announcements\",\"1.2.0\"],[\"apps\",\"notes\",\"2.4.0\"],[\"apps\",\"notifications\",\"2.1.2\"],[\"apps\",\"oauth2\",\"1.1.1\"],[\"apps\",\"ocdownloader\",\"1.5.6\"],[\"apps\",\"password_policy\",\"1.3.0\"],[\"apps\",\"polls\",\"0.8.1\"],[\"apps\",\"previewgenerator\",\"1.1.0\"],[\"apps\",\"provisioning_api\",\"1.3.0\"],[\"apps\",\"radio\",\"0.6.1\"],[\"apps\",\"richdocuments\",\"disabled\"],[\"apps\",\"serverinfo\",\"1.3.0\"],[\"apps\",\"sharebymail\",\"1.3.0\"],[\"apps\",\"sharepoint\",\"disabled\"],[\"apps\",\"spreed\",\"3.2.5\"],[\"apps\",\"survey_client\",\"1.1.0\"],[\"apps\",\"systemtags\",\"disabled\"],[\"apps\",\"theming\",\"1.4.5\"],[\"apps\",\"twofactor_backupcodes\",\"1.2.3\"],[\"apps\",\"twofactor_totp\",\"1.4.1\"],[\"apps\",\"unsplash\",\"1.1.1\"],[\"apps\",\"updatenotification\",\"1.3.0\"],[\"apps\",\"user_usage_report\",\"1.0.1\"],[\"apps\",\"weather\",\"1.5.1\"],[\"apps\",\"workflowengine\",\"1.3.0\"],[\"stats\",\"num_files\",838513],[\"stats\",\"num_users\",7],[\"stats\",\"num_storages\",14],[\"stats\",\"num_storages_local\",2],[\"stats\",\"num_storages_home\",8],[\"stats\",\"num_storages_other\",4],[\"stats\",\"num_comments\",2],[\"stats\",\"num_comment_markers\",2],[\"stats\",\"num_systemtags\",0],[\"stats\",\"num_systemtags_mappings\",0],[\"files_sharing\",\"num_shares\",26],[\"files_sharing\",\"num_shares_user\",23],[\"files_sharing\",\"num_shares_groups\",0],[\"files_sharing\",\"num_shares_link\",3],[\"files_sharing\",\"num_shares_link_no_password\",3],[\"files_sharing\",\"num_fed_shares_sent\",0],[\"files_sharing\",\"num_fed_shares_received\",0],[\"files_sharing\",\"permissions_3_1\",\"2\"],[\"files_sharing\",\"permissions_3_4\",\"1\"],[\"files_sharing\",\"permissions_0_17\",\"1\"],[\"files_sharing\",\"permissions_0_19\",\"2\"],[\"files_sharing\",\"permissions_0_23\",\"3\"],[\"files_sharing\",\"permissions_0_29\",\"1\"],[\"files_sharing\",\"permissions_0_31\",\"16\"]]}",
            "last_sent": "1534431619",
            "types": ""
        },
        "systemtags": {
            "enabled": "no",
            "installed_version": "1.2.0",
            "types": "logging"
        },
        "theming": {
            "backgroundMime": "image\/jpeg",
            "cachebuster": "18",
            "enabled": "yes",
            "imprintUrl": "https:\/\/1\/index.php\/s\/45A3Pq2tq2F8yJz",
            "installed_version": "1.4.5",
            "logoMime": "image\/png",
            "name": "\u041e\u0431\u043b\u0430\u043a\u0430, \u0431\u0435\u043b\u043e\u0433\u0440\u0438\u0432\u044b\u0435 \u043b\u043e\u0448\u0430\u0440\u043a\u0438",
            "slogan": "\u0422\u044b \u0442\u0430\u043c, \u0433\u0434\u0435 \u0442\u044b \u0435\u0441\u0442\u044c.",
            "types": "logging",
            "url": "https:\/\/1t"
        },
        "twofactor_backupcodes": {
            "enabled": "yes",
            "installed_version": "1.2.3",
            "types": ""
        },
        "twofactor_totp": {
            "enabled": "yes",
            "installed_version": "1.4.1",
            "types": ""
        },
        "unsplash": {
            "enabled": "yes",
            "installed_version": "1.1.1",
            "types": "authentication"
        },
        "updatenotification": {
            "bruteforcesettings": "1.1.0",
            "calendar": "1.6.1",
            "checksum": "0.4.0",
            "core": "13.0.5.2",
            "data_request": "1.0.1",
            "deck": "0.4.1",
            "enabled": "yes",
            "external": "2.0.3",
            "files_clipboard": "0.6.5",
            "files_pdfviewer": "1.2.1",
            "gpxpod": "2.2.2",
            "installed_version": "1.3.0",
            "keeweb": "0.4.0",
            "mail": "0.8.1",
            "notes": "2.4.0",
            "ocdownloader": "1.5.6",
            "polls": "0.8.1",
            "previewgenerator": "1.1.0",
            "radio": "0.6.1",
            "spreed": "3.2.5",
            "theming": "1.4.5",
            "twofactor_totp": "1.3.1",
            "types": "",
            "unsplash": "1.1.1",
            "update_check_errors": "0",
            "user_usage_report": "1.0.1"
        },
        "user_usage_report": {
            "enabled": "yes",
            "installed_version": "1.0.1",
            "types": "filesystem"
        },
        "weather": {
            "enabled": "yes",
            "installed_version": "1.5.1",
            "openweathermap_api_key": "REPLACED",
            "types": ""
        },
        "workflowengine": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "filesystem"
        }
    }
}

Are you using external storage, if yes which one: local, smb.

Are you using encryption: no

Logs

Nextcloud log (data/nextcloud.log)


Nextcloud log

{"reqId":"E0iDGlZppQ5ywSiWZxgx","level":1,"time":"2018-08-26T10:45:16+00:00","remoteAddr":"","user":"--","app":"files_trashbin","method":"--","url":"--","message":"remove \"SOME (\u043a\u043e\u043f\u0438\u044f).FILE\" (282640B) to meet the limit of trash bin size (50% of available quota)","userAgent":"--","version":"13.0.5.2"}

bug

Most helpful comment

I realized, that my trash bin never got deleted. Which makes sense based on the documentation, the default setting 'trashbin_retention_obligation' => 'auto' and my users who do not have any quota being configured.

Now I changed the setting to 'trashbin_retention_obligation' => '30,180',in config.php and even after deleting files, adding new files and ensuring the the cron job is working correctly every 5 minutes, I still have files in my trash bin older then 180 days. Actually I have still files in there from the date I installed the trash bin app.

Someone said that it is necessary to add another cron job executing occ trashbin:expire every few minutes, but I just do not understand why? Shouldn't it be there from the beginning if necessary.

I started with NC 13.x and upgraded from there to 17.0.2 over the last few years :)

There are some discussion already on the forum, but nobody really seems to know how and what

thanks

All 11 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/5534 (Empty trash), https://github.com/nextcloud/server/issues/8858 ((please ignore)), https://github.com/nextcloud/server/issues/9336 (Question about trash), https://github.com/nextcloud/server/issues/1112 (Errors accessing trash bin), and https://github.com/nextcloud/server/issues/7053 (Emptying trash bin gives the impression of failing, and removes too much).

Update ticket - still have this problem after update to 14.0.3

https://github.com/nextcloud/server/blob/4adac445dc57d1ccc7f26e21018e1e731e5b1654/apps/files_trashbin/lib/Trashbin.php#L716-L734

Yes. If a new file is added to nextcloud or a file is moved to trash an expire command is started for the user. When the $availableSpace is smaller than 0 after deleting expired files the trashbin_retention_obligation is ignored and files from trashbin are deleted. I'm not sure yet but i think something with calculateFreeSpace is wrong.

Just update my NC to 15.0.2 and problem exist - basically everything is deleted when cron job executed.
Place being used by my account:
image

Test file was deleted and this is what appears in Log:
image

Somehow I find out that in my user Trashbin were huge (around 20GB) old files under data/USER/file_trashbin/files, but they were not visible in NC GUI. I delete them manually and problem still exist.

This has to do with external storage.
Adding the following to calculateFreeSpace() in server/apps/files_trashbin/lib/Trashbin.php

\OC::$server->getLogger()->info('$quota: ' . $quota . ', $softQuota: ' . $softQuota, ['app' => 'files_trashbin']);
\OC::$server->getLogger()->info('$free: ' . $free . ', $userFolder->getSize(): ' . $userFolder->getSize(), ['app' => 'files_trashbin']);

logs the following:

$quota: 21474836480, $softQuota: 1
$free: -993058727443, $userFolder->getSize(): 1014533563923

$quota is the correct quota (20 GB for my user), $userFolder->getSize() includes 940 GB of an external storage that isn't counted towards my quota.
$free should ignore external storage.
Not sure how to fix this, yet...

The versions app uses the following snippet to calculate free space:
https://github.com/nextcloud/server/blob/4adac445dc57d1ccc7f26e21018e1e731e5b1654/apps/files_versions/lib/Storage.php#L756-L758
Calling getFileInfo(..., false) means $includeMountPoints=false, so this seems like a possible fix.

Found the commit that changed this: de58364
@MorrisJobke: could you comment on this and whether it's safe to revert to using getFileInfo(..., false)?

Got this error by checking of my trash bin after update to NC 15.0.6:
image

# grep "TypeError" data/nextcloud.log
{"reqId":"DPC6kE4c1B0eq0izGxGd","level":3,"time":"2019-04-08T12:08:03+00:00","remoteAddr":"10.10.10.10","user":"gas","app":"remote","method":"PROPFIND","url":"\/remote.php\/dav\/trashbin\/gas\/trash","message":{"Exception":"TypeError","Message":"Return value of OCA\\Files_Trashbin\\Sabre\\AbstractTrash::getSize() must be of the type integer, float returned","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/PropFind.php","line":98,"function":"getSize","class":"OCA\\Files_Trashbin\\Sabre\\AbstractTrash","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php","line":797,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->","args":["{DAV:}getcontentlength",[{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashFile"},"getSize"]]},{"function":"propFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashFile"}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"propFind"],[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashFile"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":1059,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["propFind",[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashFile"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":981,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashFile"}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":1666,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["trashbin\/gas\/trash",["{http:\/\/nextcloud.org\/ns}trashbin-filename","{http:\/\/nextcloud.org\/ns}trashbin-deletion-time","{http:\/\/nextcloud.org\/ns}trashbin-original-location","{DAV:}getlastmodified","{DAV:}getetag","{DAV:}getcontenttype","{DAV:}resourcetype","{http:\/\/owncloud.org\/ns}fileid","{http:\/\/owncloud.org\/ns}permissions","{http:\/\/owncloud.org\/ns}size","{DAV:}getcontentlength","{http:\/\/nextcloud.org\/ns}has-preview","{http:\/\/nextcloud.org\/ns}mount-type","{http:\/\/nextcloud.org\/ns}is-encrypted","{http:\/\/open-collaboration-services.org\/ns}share-permissions","{http:\/\/owncloud.org\/ns}comments-unread"],1]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php","line":355,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Generator"},false]},{"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https:\/\/gas85.ddns.net\/remote.php\/dav\/trashbin\/gas\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpPropFind"],[{"absoluteUrl":"https:\/\/gas85.ddns.net\/remote.php\/dav\/trashbin\/gas\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:PROPFIND",[{"absoluteUrl":"https:\/\/gas85.ddns.net\/remote.php\/dav\/trashbin\/gas\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https:\/\/gas85.ddns.net\/remote.php\/dav\/trashbin\/gas\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/nextcloud\/apps\/dav\/lib\/Server.php","line":301,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/remote.php","line":163,"args":["\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/apps\/files_trashbin\/lib\/Sabre\/AbstractTrash.php","Line":59,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko\/20100101 Firefox\/66.0","version":"15.0.6.1"}

After this nothing happens. I could not open trash bin from the WebUI... Android App also give an error.
After Android App i can find following in logs:

{"reqId":"zKnrzUNivkoXFfOhG9T1","level":4,"time":"2019-04-08T12:22:12+00:00","remoteAddr":"10.10.10.10","user":"gas","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/trashbin\/gas\/trash\/\/","message":{"Exception":"Sabre\\DAV\\Exception","Message":"The REQUEST_URI (\/remote.php\/dav\/trashbin\/gas\/trash\/\/) did not end with the contents of PATH_INFO (\/dav\/trashbin\/USER\/trash\/). This server might be misconfigured.","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":349,"function":"guessBaseUri","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":253,"function":"getBaseUri","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/remote.php","line":72,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/remote.php","line":168,"function":"handleException","args":[{"__class__":"TypeError"}]}],"File":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","Line":387,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.5.1","version":"15.0.6.1"}

Just reproduced on 16.0.6. Scenario has being changed a bit.

  1. When you have quota usage > 50% check trash bin - it is full of different files.
  2. Delete some huge (10 GB) file when you have quota usage > 50%
  3. Check trash bin - it is there
  4. Wait for cron job finished
  5. Check trash bin - file is not there as also all other files.
  6. Check logs and see a lot of: Info | files_trashbin | remove "SOME.FILE" (282640B) to meet the limit of trash bin size (50% of available quota)

Basically 1 huge file "pushed to remove" all other files from the trash bin and also itself.
image

I realized, that my trash bin never got deleted. Which makes sense based on the documentation, the default setting 'trashbin_retention_obligation' => 'auto' and my users who do not have any quota being configured.

Now I changed the setting to 'trashbin_retention_obligation' => '30,180',in config.php and even after deleting files, adding new files and ensuring the the cron job is working correctly every 5 minutes, I still have files in my trash bin older then 180 days. Actually I have still files in there from the date I installed the trash bin app.

Someone said that it is necessary to add another cron job executing occ trashbin:expire every few minutes, but I just do not understand why? Shouldn't it be there from the beginning if necessary.

I started with NC 13.x and upgraded from there to 17.0.2 over the last few years :)

There are some discussion already on the forum, but nobody really seems to know how and what

thanks

Was this page helpful?
0 / 5 - 0 ratings