"Exception Inconsistent data, File unshared, but owner not found. Should not happen" and "NotFoundException Exception thrown: OCP\Files\NotFoundException"

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 9 30.0.6
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04
  • Web server and version (e.g, Apache 2.4.25):
    • Nginx 1.26.3
  • PHP version (e.g, 8.3):
    • PHP 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After I followed instruction in Nextcloud > Administration > Security, to type in occ encryption:encrypt-all
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • VPS/Web Installer
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

After I followed instruction in Nextcloud > Administration > Security, to type in occ encryption:encrypt-all, I got the errors:
Exception Inconsistent data, File unshared, but owner not found. Should not happen
NotFoundException Exception thrown: OCP\Files\NotFoundException

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"1234567890","level":3,"time":"2025-04-12T09:13:31+08:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Exception thrown: Exception","userAgent":"--","version":"30.0.6.2","exception":{"Exception":"Exception","Message":"Inconsistent data, File unshared, but owner not found. Should not happen","Code":0,"Trace":[{"file":"/home/user/htdocs/website.com/lib/private/Encryption/HookManager.php","line":31,"function":"getUpdate","class":"OC\\Encryption\\HookManager","type":"::"},{"file":"/home/user/htdocs/website.com/lib/private/legacy/OC_Hook.php","line":82,"function":"postRename","class":"OC\\Encryption\\HookManager","type":"::"},{"file":"/home/user/htdocs/website.com/lib/private/Files/View.php","line":830,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":282,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":254,"function":"encryptFile","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":224,"function":"encryptUsersFiles","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":198,"function":"encryptAllUserFilesWithMasterKey","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":148,"function":"encryptAllUsersFiles","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/Encryption.php","line":467,"function":"encryptAll","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/core/Command/Encryption/EncryptAll.php","line":88,"function":"encryptAll","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Command/Command.php","line":326,"function":"execute","class":"OC\\Core\\Command\\Encryption\\EncryptAll","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Application.php","line":1078,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Application.php","line":324,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Application.php","line":175,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/Console/Application.php","line":183,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/console.php","line":87,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/occ","line":11,"args":["/home/user/htdocs/website.com/console.php"],"function":"require_once"}],"File":"/home/user/htdocs/website.com/lib/private/Encryption/HookManager.php","Line":45,"CustomMessage":"Exception thrown: Exception"},"id":"67f9e404d4769"}
{"reqId":"1234567890","level":3,"time":"2025-04-12T09:13:31+08:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Exception thrown: OCP\\Files\\NotFoundException","userAgent":"--","version":"30.0.6.2","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/home/user/htdocs/website.com/lib/private/Files/Node/Node.php","line":363,"function":"getFileInfo","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/home/user/htdocs/website.com/apps/files_versions/lib/Listener/FileEventsListener.php","line":362,"function":"getOwner","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/home/user/htdocs/website.com/apps/files_versions/lib/Listener/FileEventsListener.php","line":287,"function":"getPathForNode","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->"},{"file":"/home/user/htdocs/website.com/apps/files_versions/lib/Listener/FileEventsListener.php","line":96,"function":"rename_hook","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/EventDispatcher/ServiceEventListener.php","line":68,"function":"handle","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":220,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":56,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/EventDispatcher/EventDispatcher.php","line":67,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/EventDispatcher/EventDispatcher.php","line":79,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/Files/Node/HookConnector.php","line":169,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/legacy/OC_Hook.php","line":82,"function":"postRename","class":"OC\\Files\\Node\\HookConnector","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/Files/View.php","line":830,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":282,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":254,"function":"encryptFile","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":224,"function":"encryptUsersFiles","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":198,"function":"encryptAllUserFilesWithMasterKey","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/EncryptAll.php","line":148,"function":"encryptAllUsersFiles","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/apps/encryption/lib/Crypto/Encryption.php","line":467,"function":"encryptAll","class":"OCA\\Encryption\\Crypto\\EncryptAll","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/core/Command/Encryption/EncryptAll.php","line":88,"function":"encryptAll","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Command/Command.php","line":326,"function":"execute","class":"OC\\Core\\Command\\Encryption\\EncryptAll","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Application.php","line":1078,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Application.php","line":324,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/3rdparty/symfony/console/Application.php","line":175,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/lib/private/Console/Application.php","line":183,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/console.php","line":87,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/home/user/htdocs/website.com/occ","line":11,"args":["/home/user/htdocs/website.com/console.php"],"function":"require_once"}],"File":"/home/user/htdocs/website.com/lib/private/Files/Node/Node.php","Line":90,"CustomMessage":"Exception thrown: OCP\\Files\\NotFoundException"},"id":"67f9e404d47b9"}

Web server / Reverse Proxy

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

2025/04/12 06:21:27 [notice] 190344#190344: signal process started
2025/04/12 08:49:06 [warn] 365618#365618: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:06 [warn] 365618#365618: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:06 [warn] 365618#365618: "ssl_stapling" ignored, issuer certificate not found f>
2025/04/12 08:49:06 [warn] 365621#365621: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:06 [warn] 365621#365621: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:06 [warn] 365621#365621: "ssl_stapling" ignored, issuer certificate not found f>
2025/04/12 08:49:19 [warn] 365708#365708: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:19 [warn] 365708#365708: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:19 [warn] 365708#365708: "ssl_stapling" ignored, issuer certificate not found f>
2025/04/12 08:49:19 [warn] 365710#365710: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:19 [warn] 365710#365710: the "listen ... http2" directive is deprecated, use th>
2025/04/12 08:49:19 [warn] 365710#365710: "ssl_stapling" ignored, issuer certificate not found f>
2025/04/12 08:50:21 [info] 376110#376110: [ngx_pagespeed 1.15.0.0-8917] No threading detected. O>
2025/04/12 08:50:21 [info] 376110#376110: pagespeed: rollback gzip, explicit configuration in /e>

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

PHP Warning:  Module "gmp" is already loaded in Unknown on line 0
PHP Warning:  Module "intl" is already loaded in Unknown on line 0
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "website.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.6.2",
        "overwrite.cli.url": "https:\/\/website.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance_window_start": 1,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6973
        },
        "maintenance": false,
        "default_phone_region": "LL",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "587",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "app_install_overwrite": [
            "sharingpath"
        ],
        "logtimezone": "Continent\/Country",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "logfile_audit": "\/var\/log\/nextcloud\/audit.log",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "log_query": false,
        "loglevel": 2,
        "log_rotate_size": 0
    }
}

Apps

The output of occ app:list (if possible).

PHP Warning:  Module "gmp" is already loaded in Unknown on line 0
PHP Warning:  Module "intl" is already loaded in Unknown on line 0
Enabled:
  - activity: 3.0.0
  - bruteforcesettings: 3.0.0
  - cfg_share_links: 7.0.1
  - cloud_federation_api: 1.13.0
  - dav: 1.31.1
  - encryption: 2.18.0
  - end_to_end_encryption: 1.16.2
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_external: 1.22.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - sharingpath: 0.4.4
  - support: 2.0.0
  - survey_client: 2.0.0
  - text: 4.1.0
  - theming: 2.6.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_totp: 12.0.0-dev
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.20.0
  - app_api: 4.0.6 (installed 4.0.6)
  - audioplayer: 3.4.1 (installed 3.4.1)
  - circles: 30.0.0 (installed 30.0.0)
  - comments: 1.20.1 (installed 1.20.1)
  - contactsinteraction: 1.11.0 (installed 1.11.0)
  - dashboard: 7.10.0 (installed 7.10.0)
  - firstrunwizard: 3.0.0 (installed 3.0.0)
  - photos: 3.0.2 (installed 3.0.2)
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0 (installed 1.20.0)
  - tasks: 0.16.1 (installed 0.16.1)
  - twofactor_nextcloud_notification: 4.0.0 (installed 4.0.0)
  - user_ldap: 1.21.0
  - weather_status: 1.10.0 (installed 1.10.0)