Skip to content

[Bug]: files_trashbin logged NotFoundException /USERNAME/files_trashbin Error while expiring trashbin for user USERNAME #61224

@invario

Description

@invario

⚠️ This issue respects the following points: ⚠️

Bug description

From a completely clean developmental install of NC master branch. The only user on the system is currently named admin.

NotFoundException /admin/files_trashbin - Error while expiring trashbin for user admin.

This reoccurs every 35 minutes so it's from a cronjob. It is possible that this stems from my 'trashbin_retention_obligation' => '10, 2' entry in config.php.

Image

Steps to reproduce

  1. Fresh install
  2. Add entry for 'trashbin_retention_obligation' => '10, 2' to config.php
  3. Error eventually occurs from the cronjob and every 35 minutes after.

Expected behavior

No error should be logged because files_trashbin should have been created already.

Nextcloud Server version

35 (master)

Operating system

Other

PHP engine version

PHP 8.4

Web server

Nginx

Database engine version

MariaDB

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud3.MYDOMAIN.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "35.0.0.1",
        "overwrite.cli.url": "https:\/\/nextcloud3.MYDOMAIN.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "git",
        "installed": true,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "logfile": "\/mnt\/nextcloud_data\/nextcloud.log",
        "loglevel": 2,
        "enabledPreviewProviders": [
            "OC\\Preview\\HEIC",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP4",
            "OC\\Preview\\AVI",
            "OC\\Preview\\Movie",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\PNG",
            "OC\\Preview\\Image",
            "OC\\Preview\\TIFF"
        ],
        "filelocking.enabled": true,
        "default_locale": "en_US",
        "default_phone_region": "US",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "cropimagepreviews": "0",
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "logtimezone": "America\/New_York",
        "overwritehost": "nextcloud3.MYDOMAIN.com",
        "overwriteprotocol": "https",
        "maintenance_window_start": 8,
        "trashbin_retention_obligation": "10, 2",
        "mail_smtpport": "465",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": ""
    }
}

List of activated Apps

Enabled:
  - admin_audit: 2.0.0-dev.0
  - appstore: 2.0.0-dev.0
  - cloud_federation_api: 2.0.0-dev.0
  - comments: 2.0.0-dev.0
  - contactsinteraction: 2.0.0-dev.0
  - dashboard: 8.0.0-dev.0
  - dav: 2.0.0-dev.0
  - federatedfilesharing: 2.0.0-dev.0
  - federation: 2.0.0-dev.0
  - files: 3.0.0-dev.0
  - files_external: 2.0.0-dev.0
  - files_reminders: 2.0.0-dev.0
  - files_sharing: 2.0.0-dev.0
  - files_trashbin: 2.0.0-dev.0
  - files_versions: 2.0.0-dev.0
  - logreader: 8.0.0-dev.0
  - lookup_server_connector: 2.0.0-dev.0
  - notifications: 8.0.0-dev.0
  - oauth2: 2.0.0-dev.0
  - photos: 8.0.0-dev.0
  - profile: 2.0.0-dev.0
  - provisioning_api: 2.0.0-dev.0
  - serverinfo: 7.0.0-dev.0
  - settings: 2.0.0-dev.0
  - sharebymail: 2.0.0-dev.0
  - systemtags: 2.0.0-dev.0
  - theming: 3.0.0-dev.0
  - twofactor_backupcodes: 2.0.0-dev.0
  - updatenotification: 2.0.0-dev.0
  - user_status: 2.0.0-dev.0
  - viewer: 8.0.0-dev.0
  - weather_status: 2.0.0-dev.0
  - webhook_listeners: 2.0.0-dev.0
  - workflowengine: 3.0.0-dev.0
Disabled:
  - encryption: 3.0.0-dev.0
  - memories: 8.0.1
  - previewgenerator: 5.13.0
  - testing: 2.0.0-dev.0
  - user_ldap: 2.0.0-dev.0

Nextcloud Signing status

Integrity checker has been disabled. Integrity cannot be verified.

Nextcloud Logs

{
  "reqId": "ztkclVpYDSlzwac2aLbu",
  "level": 3,
  "time": "2026-06-11T16:30:00-04:00",
  "remoteAddr": "",
  "user": "--",
  "app": "files_trashbin",
  "method": "",
  "url": "--",
  "scriptName": "/var/www/html/cron.php",
  "message": "Error while expiring trashbin for user admin",
  "userAgent": "--",
  "version": "35.0.0.0",
  "occ_command": [
    "/var/www/html/cron.php"
  ],
  "exception": {
    "Exception": "OCP\\Files\\NotFoundException",
    "Message": "/admin/files_trashbin",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/Files/Node/LazyFolder.php",
        "line": 142,
        "function": "get",
        "class": "OC\\Files\\Node\\Root",
        "type": "->",
        "args": [
          "/admin/files_trashbin"
        ]
      },
      {
        "file": "/var/www/html/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php",
        "line": 93,
        "function": "get",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->",
        "args": [
          "files_trashbin"
        ]
      },
      {
        "file": "/var/www/html/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php",
        "line": 72,
        "function": "getTrashRoot",
        "class": "OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\User\\LazyUser"
          }
        ]
      },
      {
        "file": "/var/www/html/lib/public/BackgroundJob/Job.php",
        "line": 51,
        "function": "run",
        "class": "OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash",
        "type": "->",
        "args": [
          null
        ]
      },
      {
        "file": "/var/www/html/lib/public/BackgroundJob/TimedJob.php",
        "line": 87,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\BackgroundJob\\JobList"
          }
        ]
      },
      {
        "file": "/var/www/html/core/Service/CronService.php",
        "line": 204,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\BackgroundJob\\JobList"
          }
        ]
      },
      {
        "file": "/var/www/html/core/Service/CronService.php",
        "line": 107,
        "function": "runCli",
        "class": "OC\\Core\\Service\\CronService",
        "type": "->",
        "args": [
          "cron",
          null
        ]
      },
      {
        "file": "/var/www/html/cron.php",
        "line": 52,
        "function": "run",
        "class": "OC\\Core\\Service\\CronService",
        "type": "->",
        "args": [
          null
        ]
      }
    ],
    "File": "/var/www/html/lib/private/Files/Node/Root.php",
    "Line": 157,
    "message": "Error while expiring trashbin for user admin",
    "exception": "{\"class\":\"OCP\\Files\\NotFoundException\",\"message\":\"/admin/files_trashbin\",\"code\":0,\"file\":\"/var/www/html/lib/private/Files/Node/Root.php:157\",\"trace\":\"#0 /var/www/html/lib/private/Files/Node/LazyFolder.php(142): OC\\Files\\Node\\Root->get('/admin/files_tr...')\\n#1 /var/www/html/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php(93): OC\\Files\\Node\\LazyFolder->get('files_trashbin')\\n#2 /var/www/html/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php(72): OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash->getTrashRoot(Object(OC\\User\\LazyUser))\\n#3 /var/www/html/lib/public/BackgroundJob/Job.php(51): OCA\\Files_Trashbin\\BackgroundJob\\ExpireTrash->run(NULL)\\n#4 /var/www/html/lib/public/BackgroundJob/TimedJob.php(87): OCP\\BackgroundJob\\Job->start(Object(OC\\BackgroundJob\\JobList))\\n#5 /var/www/html/core/Service/CronService.php(204): OCP\\BackgroundJob\\TimedJob->start(Object(OC\\BackgroundJob\\JobList))\\n#6 /var/www/html/core/Service/CronService.php(107): OC\\Core\\Service\\CronService->runCli('cron', NULL)\\n#7 /var/www/html/cron.php(52): OC\\Core\\Service\\CronService->run(NULL)\\n#8 {main}\"}",
    "CustomMessage": "Error while expiring trashbin for user admin"
  },
  "id": "6a2b1f202b741"
}

Additional info

In my NC data folder under the user admin, the directory files_trashbin is, in fact, missing so it would appear the whatever the scheduled job that goes off every 35 minutes is looking for the non-existent files_trashbin directory that somehow wasn't created during server setup.

If I upload a file to NC and then proceed to delete it, the files_trashbin directory is created and the error stops.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    Status
    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions