nextcloud / server

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

[Bug]: Nextcloud 28.0.0 Error "NotFoundException" #42343

Open hammeractual opened 11 months ago

hammeractual commented 11 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Ater upgrading Nextcloud (from version 27.1.2 to 28.0.0) error happened:

image ~~1. TypeError OCA\Photos\Service\ReverseGeoCoderService::getPlaceForCoordinates(): Argument#1 ($latitude) must be of type float, null given

  1. Undefined array key "longitude"
  2. Undefined array key "latitude"~~

image

  1. NotFoundException Exception thrown: OCP\Files\NotFoundException Exception thrown: OCP\Files\NotFoundException

Steps to reproduce

1. 2. 3.

Expected behavior

None of those errors should happened.

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 22 to 23)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

joshtrichards commented 11 months ago

Duplicate of nextcloud/photos#2187

hammeractual commented 11 months ago

Duplicate of nextcloud/photos#2187

But, what about error "NotFoundException"? image

Do you have any idea about that?

joshtrichards commented 11 months ago

Not sure. I guess I missed you reported two distinct items in one issue. Next time please create independent issues for different matters please. :-)

Can you provide the entire raw stack trace for the second matter?

And also provide the missing items from the report template - namely your base configuration occ config:list system and installed apps occ app:list.

hammeractual commented 11 months ago

Not sure. I guess I missed you reported two distinct items in one issue. Next time please create independent issues for different matters please. :-)

Can you provide the entire raw stack trace for the second matter?

And also provide the missing items from the report template - namely your base configuration occ config:list system and installed apps occ app:list.

Oh ok, I'm sorry for my mistake.

Here is the raw stack trace:

{
  "reqId": "jaLOVPszqGWtcYMj5srL",
  "level": 3,
  "time": "2023-12-14T08:39:35+00:00",
  "remoteAddr": "172.16.1.2",
  "user": "--",
  "app": "no app in context",
  "method": "MOVE",
  "url": "/public.php/webdav/11-12-2023%20Upgrade%20Software%20VM%20Aplikasi%20dan%20Instalasi%20PHP%208.1.docx",
  "message": "Exception thrown: OCP\\Files\\NotFoundException",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
  "version": "28.0.0.11",
  "exception": {
    "Exception": "OCP\\Files\\NotFoundException",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/nextcloud/lib/private/Files/Node/Node.php",
        "line": 386,
        "function": "getFileInfo",
        "class": "OC\\Files\\Node\\Node",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
        "line": 358,
        "function": "getOwner",
        "class": "OC\\Files\\Node\\Node",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
        "line": 301,
        "function": "getPathForNode",
        "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
        "line": 118,
        "function": "rename_hook",
        "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 86,
        "function": "handle",
        "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 230,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 59,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 94,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 106,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/Files/Node/HookConnector.php",
        "line": 185,
        "function": "dispatchTyped",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/legacy/OC_Hook.php",
        "line": 105,
        "function": "postRename",
        "class": "OC\\Files\\Node\\HookConnector",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/Files/View.php",
        "line": 837,
        "function": "emit",
        "class": "OC_Hook",
        "type": "::"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Node.php",
        "line": 159,
        "function": "rename",
        "class": "OC\\Files\\View",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 159,
        "function": "setName",
        "class": "OCA\\DAV\\Connector\\Sabre\\Node",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 612,
        "function": "move",
        "class": "Sabre\\DAV\\Tree",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpMove",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php",
        "line": 124,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/public.php",
        "line": 81,
        "args": [
          "/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/nextcloud/lib/private/Files/Node/Node.php",
    "Line": 113,
    "CustomMessage": "Exception thrown: OCP\\Files\\NotFoundException"
  },
  "id": "65828eb9687c0"
}

Here is the output for config:list system:

root@d:/var/www/html/nextcloud# sudo -u www-data php occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "10.58.255.9",
            "xxx.xxx.xxx"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.0.11",
        "overwrite.cli.url": "https:\/\/xxx.xxx.xxx\/",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 0
        },
        "default_phone_region": "ID",
        "default_locale": "id_ID",
        "simpleSignUpLink.shown": false,
        "auth.webauthn.enabled": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "ldapUserCleanupInterval": 60,
        "lost_password_link": "disabled",
        "allow_local_remote_servers": true,
        "loglevel": 2,
        "maintenance": false,
        "session_lifetime": 604800,
        "session_keepalive": true,
        "remember_login_cookie_lifetime": 1296000,
        "allow_user_to_change_display_name": false,
        "enable_previews": true,
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "preview_concurrency_all": 32,
        "preview_concurrency_new": 16,
        "preview_max_memory": 384,
        "preview_max_filesize_image": 10,
        "enabledPreviewProviders": [
            "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"
        ],
        "data-fingerprint": "55ee62a8999cc76e749b6ac7e5a3c586"
    }
}

Here is the output for app:list:

root@d:/var/www/html/nextcloud# sudo -u www-data php occ app:list
Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contactsinteraction: 1.9.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_antivirus: 5.4.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - forms: 4.0.0
  - impersonate: 1.15.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - previewgenerator: 5.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.0
  - sharebymail: 1.18.0
  - support: 1.11.0
  - survey_client: 1.16.0
  - systemtags: 1.18.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_ldap: 1.19.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - workflowengine: 2.10.0
Disabled:
  - bruteforcesettings: 2.8.0
  - circles: 28.0.0-dev (installed 27.0.1)
  - dashboard: 7.8.0 (installed 7.5.0)
  - encryption: 2.16.0
  - files_external: 1.20.0
  - suspicious_login: 6.0.0
  - twofactor_totp: 10.0.0-beta.2
  - weather_status: 1.8.0 (installed 1.5.0)
nextcloud-command commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

joshtrichards commented 9 months ago

Do you have a way of reproducing this error on-demand on-demand? It looks like it is a public share that someone is doing a rename/move operation on.

Is the original file just a normal file shared directly by a single user? Is it re-shared or anything like that?

You appear to have External Storage disabled so at least we know it's not associated with that.

Related (possibly/probably): #41654

hammeractual commented 9 months ago

Do you have a way of reproducing this error on-demand on-demand? It looks like it is a public share that someone is doing a rename/move operation on.

Is the original file just a normal file shared directly by a single user? Is it re-shared or anything like that?

You appear to have External Storage disabled so at least we know it's not associated with that.

Related (possibly/probably): #41654

I'm sorry, I can't reproduce the issue on demand and I don't know what thing that triggered the error. I just randomly watch the Log and found that strange error was happened.

But, I believe that error caused by moving/copying files inside nextcloud through Nextcloud Web UI.

joshtrichards commented 9 months ago

Breadcrumbs for future follow-up:

madtownchris commented 4 months ago

I seem to be having this same exception / error (see this for more details.

I can reproduce it from the command line and have been printing debug information though I don't know enough to understand what it means.

It seems the issue stems from View->getCacheEntry(). In there $data is null from the cache so it looks like it's going to recreate it. But $storage->file_exists() returns false.

That bubbles up to View->getFileInfo where $data is not an ICacheEntry which returns false to Node->getFileInfo which throws the exception.

Logging Local->file_exists shows I guess expected paths.

But the strange thing is this: when I move a file from test-image.png to test-image2.png, the first exception occurs when checking for test-image2.png. This appears to be near the start of the move process.

So it's like it thinks the file has been moved in the file system and is looking for test-image2.png but it has not yet been moved and then the exception.

Oddly as my support post describes, eventually the move works but slowly. Maybe php exceptions are really slow and that's part of the problem.

I'm willing to log some more information if that helps. Also if there's a better way to use the logging system than print statements that would be nice to know.

Mendrace commented 2 months ago

I have the same problem in Nextcloud 29.0.6.

nextcloud_error

Mendrace commented 2 months ago

Raw stack trace:

{
  "reqId": "8nmUIXS3bB4MK6lYSTAy",
  "level": 3,
  "time": "2024-09-11T06:57:16+00:00",
  "remoteAddr": "172.xx.xx.x",
  "user": "--",
  "app": "no app in context",
  "method": "MOVE",
  "url": "/public.php/dav/files/RQqNjAHSW8jmYLS/Mangascha%20Biratu%2C%20Yafit.pdf",
  "message": "Exception thrown: OCP\\Files\\NotFoundException",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0",
  "version": "29.0.6.1",
  "exception": {
    "Exception": "OCP\\Files\\NotFoundException",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/Node.php",
        "line": 386,
        "function": "getFileInfo",
        "class": "OC\\Files\\Node\\Node",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
        "line": 385,
        "function": "getOwner",
        "class": "OC\\Files\\Node\\Node",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
        "line": 352,
        "function": "getPathForNode",
        "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
        "line": 127,
        "function": "pre_renameOrCopy_hook",
        "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 86,
        "function": "handle",
        "class": "OCA\\Files_Versions\\Listener\\FileEventsListener",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 230,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 59,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 86,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 98,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/HookConnector.php",
        "line": 174,
        "function": "dispatchTyped",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/legacy/OC_Hook.php",
        "line": 105,
        "function": "rename",
        "class": "OC\\Files\\Node\\HookConnector",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/View.php",
        "line": 770,
        "function": "emit",
        "class": "OC_Hook",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php",
        "line": 159,
        "function": "rename",
        "class": "OC\\Files\\View",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 171,
        "function": "setName",
        "class": "OCA\\DAV\\Connector\\Sabre\\Node",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 612,
        "function": "move",
        "class": "Sabre\\DAV\\Tree",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpMove",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/appinfo/v2/publicremote.php",
        "line": 155,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/public.php",
        "line": 107,
        "args": [
          "/var/www/nextcloud/apps/dav/appinfo/v2/publicremote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Files/Node/Node.php",
    "Line": 113,
    "CustomMessage": "Exception thrown: OCP\\Files\\NotFoundException"
  },
  "id": "66e187137490d"
}