server icon indicating copy to clipboard operation
server copied to clipboard

Error when loading files: The view passed to the node should not have any fake root set

Open Voltra opened this issue 1 year ago • 25 comments

⚠️ This issue respects the following points: ⚠️

Bug description

When navigating to files, there's an error message: This directory is unavailable, please check the logs or contact the administrator

In Admin > Overview, there's a new error message: Your web server is not yet properly set up to allow file synchronization, because the WebDAV interface seems to be broken..

In Admin > Logging, there's a lot of the same PHP exception being thrown: OCP\PreConditionNotMetException: The view passed to the node should not have any fake root set

Steps to reproduce

  1. Have an existing ^25.0.0 Nextcloud app
  2. Update to 25.0.7
  3. Log in
  4. Go to the file tab
  5. Notice an error message pops up: This directory is unavailable, please check the logs or contact the administrator

Expected behavior

Be able to access files just like I could before the update.

Installation method

Other Community project

Nextcloud Server version

25

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Apache (supported)

Database engine version

MySQL

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

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

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

Configuration report

{
    "system": {
        "dbtype": "mysql",
        "version": "25.0.7.1",
        "mysql.utf8mb4": true,
        "installed": true,
        "force_locale": "en_US",
        "default_locale": "en_US",
        "force_language": "en",
        "default_language": "en",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtpport": "465",
        "maintenance": false,
        "loglevel": 2
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - admin_audit: 1.15.0
  - bruteforcesettings: 2.5.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - encryption: 2.13.0
  - federatedfilesharing: 1.15.0
  - files: 1.20.1
  - files_downloadactivity: 1.16.0
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recommendations: 1.4.0
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - spreed: 15.0.6
  - support: 1.8.0
  - survey_client: 1.13.0
  - suspicious_login: 4.3.0
  - systemtags: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - twofactor_totp: 7.0.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0
Disabled:
  - accessibility
  - federation: 1.15.0
  - files_external
  - files_videoplayer
  - impersonate: 1.12.1
  - openotp_auth: 1.5.0
  - ransomware_protection: 1.14.0
  - related_resources: 1.0.4
  - user_ldap

Nextcloud Signing status

No response

Nextcloud Logs

{
  "reqId": "XXXXX",
  "level": 3,
  "time": "XXXXX",
  "remoteAddr": "XXXXX",
  "user": "XXXXX",
  "app": "webdav",
  "method": "PROPFIND",
  "url": "/remote.php/webdav",
  "message": "The view passed to the node should not have any fake root set",
  "userAgent": "XXXXX",
  "version": "25.0.7.1",
  "exception": {
    "Exception": "OCP\\PreConditionNotMetException",
    "Message": "The view passed to the node should not have any fake root set",
    "Code": 0,
    "Trace": [
      {
        "file": "/XXXXX/apps/dav/lib/Connector/Sabre/Node.php",
        "line": 105,
        "function": "__construct",
        "class": "OC\\Files\\Node\\Node",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Node\\LazyRoot"
          ],
          [
            "OC\\Files\\View"
          ],
          "/",
          [
            "OC\\Files\\Node\\LazyUserFolder"
          ]
        ]
      },
      {
        "file": "/XXXXX/apps/dav/lib/Connector/Sabre/Directory.php",
        "line": 78,
        "function": "__construct",
        "class": "OCA\\DAV\\Connector\\Sabre\\Node",
        "type": "->",
        "args": [
          [
            "OC\\Files\\View"
          ],
          [
            "OC\\Files\\Node\\LazyUserFolder"
          ],
          null
        ]
      },
      {
        "file": "/XXXXX/apps/dav/lib/Connector/Sabre/ServerFactory.php",
        "line": 142,
        "function": "__construct",
        "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
        "type": "->",
        "args": [
          [
            "OC\\Files\\View"
          ],
          [
            "OC\\Files\\Node\\LazyUserFolder"
          ],
          [
            "OCA\\DAV\\Connector\\Sabre\\ObjectTree"
          ]
        ]
      },
      {
        "file": "/XXXXX/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "OCA\\DAV\\Connector\\Sabre\\{closure}",
        "class": "OCA\\DAV\\Connector\\Sabre\\ServerFactory",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 456,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "beforeMethod:PROPFIND",
          [
            "*** sensitive parameters replaced ***",
            "*** sensitive parameters replaced ***"
          ]
        ]
      },
      {
        "file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***",
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/XXXXX/apps/dav/appinfo/v1/webdav.php",
        "line": 85,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/XXXXX/remote.php",
        "line": 172,
        "args": [
          "/XXXXX/apps/dav/appinfo/v1/webdav.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/XXXXX/lib/private/Files/Node/Node.php",
    "Line": 78,
    "message": "The view passed to the node should not have any fake root set",
    "exception": [],
    "CustomMessage": "The view passed to the node should not have any fake root set"
  },
  "id": "XXXXX"
}

Additional info

Managed app, installed via Infomaniak.

Related issue on onlyoffice and potential fix: https://forum.onlyoffice.com/t/viewing-file-history-does-not-work-in-nextcloud/5105

The proposed monkeypatch in the link above does make the files tab operational again on my system.

Voltra avatar Jun 09 '23 11:06 Voltra

We have several instances on 25.0.7, all with OnlyOffice installed and working, none has this issue. Please post the full stack logs, maybe it helps debug this.

solracsf avatar Jun 09 '23 15:06 solracsf

Here's the entire stack trace straight out of the Admin>Logging

{"reqId":"XXXXX","level":3,"time":"XXXXX","remoteAddr":"XXXXX","user":"XXXXX","app":"webdav","method":"PROPFIND","url":"/remote.php/webdav","message":"The view passed to the node should not have any fake root set","userAgent":"XXXXX","version":"25.0.7.1","exception":{"Exception":"OCP\\PreConditionNotMetException","Message":"The view passed to the node should not have any fake root set","Code":0,"Trace":[{"file":"/XXXXX/apps/dav/lib/Connector/Sabre/Node.php","line":105,"function":"__construct","class":"OC\\Files\\Node\\Node","type":"->","args":[["OC\\Files\\Node\\LazyRoot"],["OC\\Files\\View"],"/",["OC\\Files\\Node\\LazyUserFolder"]]},{"file":"/XXXXX/apps/dav/lib/Connector/Sabre/Directory.php","line":78,"function":"__construct","class":"OCA\\DAV\\Connector\\Sabre\\Node","type":"->","args":[["OC\\Files\\View"],["OC\\Files\\Node\\LazyUserFolder"],null]},{"file":"/XXXXX/apps/dav/lib/Connector/Sabre/ServerFactory.php","line":142,"function":"__construct","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":[["OC\\Files\\View"],["OC\\Files\\Node\\LazyUserFolder"],["OCA\\DAV\\Connector\\Sabre\\ObjectTree"]]},{"file":"/XXXXX/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"OCA\\DAV\\Connector\\Sabre\\{closure}","class":"OCA\\DAV\\Connector\\Sabre\\ServerFactory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeMethod:PROPFIND",["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]]},{"file":"/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/XXXXX/apps/dav/appinfo/v1/webdav.php","line":85,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/XXXXX/remote.php","line":172,"args":["/XXXXX/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/XXXXX/lib/private/Files/Node/Node.php","Line":78,"message":"The view passed to the node should not have any fake root set","exception":[],"CustomMessage":"The view passed to the node should not have any fake root set"},"id":"XXXXX"}

Voltra avatar Jun 09 '23 17:06 Voltra

  • +Config report
  • +Installed apps list
  • +Signing status

(As requested on the bug submission form)

  • +Aforementioned requested full stack trace from these various errors. [From the Web UI the easiest way to grab the entire stack trace is going over to the far right of the error log entry and clicking "Copy raw" on the clipboard icon that pops up]

joshtrichards avatar Jun 09 '23 17:06 joshtrichards

I've updated the initial issue message with the missing information that could be retrieved

Voltra avatar Jun 09 '23 17:06 Voltra

@Voltra sorry to bother you but please use this option instead.

image

Thanks 👍

solracsf avatar Jun 09 '23 19:06 solracsf

Gotcha, updated for your convenience

Voltra avatar Jun 09 '23 19:06 Voltra

@juliushaertl can you take a look please?

solracsf avatar Jun 09 '23 20:06 solracsf

This seems strange as the get(View::class) should always return a view without fake root. There could be one case when chroot is called before that.

Any change you could revert the change and apply the following change, try to load the file list and share the log entries from that attempt?

diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index 0eef2716141..479c4cfc7b1 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -74,7 +74,7 @@ class Node implements \OCP\Files\Node {
         */
        public function __construct($root, $view, $path, $fileInfo = null, ?Node $parent = null, bool $infoHasSubMountsIncluded = true) {
                if (Filesystem::normalizePath($view->getRoot()) !== '/') {
-                       throw new PreConditionNotMetException('The view passed to the node should not have any fake root set');
+                       throw new PreConditionNotMetException('The view passed to the node should not have any fake root set, but has: ' . Filesystem::normalizePath($view->getRoot()));
                }
                $this->view = $view;
                $this->root = $root;
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index d256003537d..e2e566c0b99 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -135,6 +135,9 @@ class View {
         * @param string $fakeRoot
         */
        public function chroot($fakeRoot): void {
+               \OCP\Server::get(LoggerInterface::class)->error('chroot to ' . $fakeRoot, [
+                       'exception' => new \Exception()
+               ]);
                if (!$fakeRoot == '') {
                        if ($fakeRoot[0] !== '/') {
                                $fakeRoot = '/' . $fakeRoot;

juliusknorr avatar Jun 09 '23 20:06 juliusknorr

Here's the log that I get using that patch (which surprisingly seems to have a bit more details):

{
	"reqId": "XXXXX",
	"level": 3,
	"time": "XXXXX",
	"remoteAddr": "XXXXX",
	"user": "MY_USER",
	"app": "webdav",
	"method": "PROPFIND",
	"url": "/remote.php/dav/files/MY_USER/",
	"message": "The view passed to the node should not have any fake root set, but has: /MY_USER/files",
	"userAgent": "XXXXX",
	"version": "25.0.7.1",
	"exception": {
		"Exception": "OCP\\PreConditionNotMetException",
		"Message": "The view passed to the node should not have any fake root set, but has: /MY_USER/files",
		"Code": 0,
		"Trace": [{
				"file": "/XXXXX/apps/dav/lib/Connector/Sabre/Node.php",
				"line": 105,
				"function": "__construct",
				"class": "OC\\Files\\Node\\Node",
				"type": "->",
				"args": [["OC\\Files\\Node\\LazyRoot"], ["OC\\Files\\View"], "/", ["OC\\Files\\Node\\LazyUserFolder"]]
			}, {
				"file": "/XXXXX/apps/dav/lib/Connector/Sabre/Directory.php",
				"line": 78,
				"function": "__construct",
				"class": "OCA\\DAV\\Connector\\Sabre\\Node",
				"type": "->",
				"args": [["OC\\Files\\View"], ["OC\\Files\\Node\\LazyUserFolder"], null]
			}, {
				"file": "/XXXXX/apps/dav/lib/Files/FilesHome.php",
				"line": 48,
				"function": "__construct",
				"class": "OCA\\DAV\\Connector\\Sabre\\Directory",
				"type": "->",
				"args": [["OC\\Files\\View"], ["OC\\Files\\Node\\LazyUserFolder"]]
			}, {
				"file": "/XXXXX/apps/dav/lib/Files/RootCollection.php",
				"line": 58,
				"function": "__construct",
				"class": "OCA\\DAV\\Files\\FilesHome",
				"type": "->",
				"args": [["principals/users/MY_USER", "MY_USER", "INDIVIDUAL", "en", "[email protected]"], ["OC\\Files\\Node\\LazyUserFolder"]]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAVACL/AbstractPrincipalCollection.php",
				"line": 119,
				"function": "getChildForPrincipal",
				"class": "OCA\\DAV\\Files\\RootCollection",
				"type": "->",
				"args": [["principals/users/MY_USER", "MY_USER", "INDIVIDUAL", "en", "[email protected]"]]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Tree.php",
				"line": 78,
				"function": "getChild",
				"class": "Sabre\\DAVACL\\AbstractPrincipalCollection",
				"type": "->",
				"args": ["MY_USER"]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 971,
				"function": "getNodeForPath",
				"class": "Sabre\\DAV\\Tree",
				"type": "->",
				"args": ["files/MY_USER"]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 1662,
				"function": "getPropertiesIteratorForPath",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": ["files/MY_USER", ["{DAV:}getlastmodified", "{DAV:}getetag", "{DAV:}getcontenttype", "{DAV:}resourcetype", "{http://owncloud.org/ns}fileid", "And 15 more entries, set log level to debug to see all entries"], 1]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 1647,
				"function": "writeMultiStatus",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [["Sabre\\Xml\\Writer", [], "/remote.php/dav/", ["d", "s", "oc", "nc"], []], ["Generator"], false]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
				"line": 346,
				"function": "generateMultiStatus",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [["Generator"], false]
			}, {
				"file": "/XXXXX/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
				"line": 89,
				"function": "httpPropFind",
				"class": "Sabre\\DAV\\CorePlugin",
				"type": "->",
				"args": [["Sabre\\HTTP\\Request"], ["Sabre\\HTTP\\Response"]]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 472,
				"function": "emit",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": ["method:PROPFIND", [["Sabre\\HTTP\\Request"], ["Sabre\\HTTP\\Response"]]]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 253,
				"function": "invokeMethod",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": [["Sabre\\HTTP\\Request"], ["Sabre\\HTTP\\Response"]]
			}, {
				"file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
				"line": 321,
				"function": "start",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": []
			}, {
				"file": "/XXXXX/apps/dav/lib/Server.php",
				"line": 360,
				"function": "exec",
				"class": "Sabre\\DAV\\Server",
				"type": "->",
				"args": []
			}, {
				"file": "/XXXXX/apps/dav/appinfo/v2/remote.php",
				"line": 35,
				"function": "exec",
				"class": "OCA\\DAV\\Server",
				"type": "->",
				"args": []
			}, {
				"file": "/XXXXX/remote.php",
				"line": 172,
				"args": ["/XXXXX/apps/dav/appinfo/v2/remote.php"],
				"function": "require_once"
			}
		],
		"File": "/XXXXX/lib/private/Files/Node/Node.php",
		"Line": 79,
		"message": "The view passed to the node should not have any fake root set, but has: /MY_USER/files",
		"exception": [],
		"CustomMessage": "The view passed to the node should not have any fake root set, but has: /MY_USER/files"
	},
	"id": "XXXXX"
}

Weirdly enough, View#chroot doesn't seem to get called (as I don't get a log entry for it). I also noticed, while applying the patch, that if $fakeRoot is the empty string then it's never changed to be / whereas anything else gets a slash prepended if it's not already there.

Voltra avatar Jun 10 '23 08:06 Voltra

Thanks, that just seems like a different code path (remote.php/dav instead of remote.php/webdav), therefore the exception trace is a bit longer.

The empty string should get changed to / through the Filesystem::normalizePath call

Could you add the following patch in addition to see if the view gets instantiated anywhere with a different root before?

Note this might log a lot so maybe check for the initial error and then fetch all entries that have the same reqId.

diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 3cd75040253..8b524fec7bd 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -118,6 +118,8 @@ class View {
                $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider);
                $this->userManager = \OC::$server->getUserManager();
                $this->logger = \OC::$server->get(LoggerInterface::class);
+
+               $this->logger->error('new View: ' . $root, ['exception' => new \Exception()]);
        }

        public function getAbsolutePath($path = '/') {
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 9e51d32cd56..f78280b2265 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -323,7 +323,9 @@ class Server extends ServerContainer implements IServerContainer {
                $this->registerAlias(IActionFactory::class, ActionFactory::class);

                $this->registerService(View::class, function (Server $c) {
-                       return new View();
+                       $view = new View();
+                       \OCP\Server::get(LoggerInterface::class)->error('View service requested: ' . $view->getRoot());
+                       return $view;
                }, false);

                $this->registerService(IPreview::class, function (ContainerInterface $c) {

juliusknorr avatar Jun 10 '23 10:06 juliusknorr

Message from the constructor:

{
  "reqId": "XXXXX",
  "level": 3,
  "time": "XXXXX",
  "remoteAddr": "XXXXX",
  "user": "MY_USER",
  "app": "no app in context",
  "method": "PROPFIND",
  "url": "/remote.php/dav/files/MY_USER/",
  "message": "new View: ",
  "userAgent": "XXXXX",
  "version": "25.0.7.1",
  "exception": {
    "Exception": "Exception",
    "Message": "",
    "Code": 0,
    "Trace": [{
        "file": "/XXXXX/lib/private/Server.php",
        "line": 442,
        "function": "__construct",
        "class": "OC\\Files\\View",
        "type": "->",
        "args": []
      }, {
        "file": "/XXXXX/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 163,
        "function": "OC\\{closure}",
        "class": "OC\\Server",
        "type": "->",
        "args": ["*** sensitive parameters replaced ***"]
      }, {
        "file": "/XXXXX/3rdparty/pimple/pimple/src/Pimple/Container.php",
        "line": 122,
        "function": "OC\\AppFramework\\Utility\\{closure}",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": ["*** sensitive parameters replaced ***"]
      }, {
        "file": "/XXXXX/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 130,
        "function": "offsetGet",
        "class": "Pimple\\Container",
        "type": "->",
        "args": ["RootFolder"]
      }, {
        "file": "/XXXXX/lib/private/ServerContainer.php",
        "line": 136,
        "function": "query",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": ["RootFolder", false]
      }, {
        "file": "/XXXXX/lib/private/AppFramework/Utility/SimpleContainer.php",
        "line": 57,
        "function": "query",
        "class": "OC\\ServerContainer",
        "type": "->",
        "args": ["RootFolder"]
      }, {
        "file": "/XXXXX/lib/private/Server.php",
        "line": 475,
        "function": "get",
        "class": "OC\\AppFramework\\Utility\\SimpleContainer",
        "type": "->",
        "args": ["RootFolder"]
      }, {
        "function": "OC\\{closure}",
        "class": "OC\\Server",
        "type": "->",
        "args": ["*** sensitive parameters replaced ***"]
      }, {
        "file": "/XXXXX/lib/private/Files/Node/LazyFolder.php",
        "line": 69,
        "function": "call_user_func",
        "args": [["Closure"]]
      }, {
        "file": "/XXXXX/lib/private/Files/Node/LazyRoot.php",
        "line": 40,
        "function": "__call",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->",
        "args": ["getUserFolder", ["MY_USER"]]
      }, {
        "file": "/XXXXX/lib/private/Server.php",
        "line": 1650,
        "function": "getUserFolder",
        "class": "OC\\Files\\Node\\LazyRoot",
        "type": "->",
        "args": ["MY_USER"]
      }, {
        "file": "/XXXXX/apps/dav/lib/Server.php",
        "line": 284,
        "function": "getUserFolder",
        "class": "OC\\Server",
        "type": "->",
        "args": []
      }, {
        "file": "/XXXXX/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "OCA\\DAV\\{closure}",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": ["*** sensitive parameters replaced ***"]
      }, {
        "file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 456,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": ["beforeMethod:PROPFIND", ["*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***"]]
      }, {
        "file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": ["*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***"]
      }, {
        "file": "/XXXXX/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      }, {
        "file": "/XXXXX/apps/dav/lib/Server.php",
        "line": 360,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      }, {
        "file": "/XXXXX/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      }, {
        "file": "/XXXXX/remote.php",
        "line": 172,
        "args": ["/XXXXX/apps/dav/appinfo/v2/remote.php"],
        "function": "require_once"
      }
    ],
    "File": "/XXXXX/lib/private/Files/View.php",
    "Line": 122,
    "message": "new View: ",
    "exception": [],
    "CustomMessage": "new View: "
  },
  "id": "XXXXX"
}

And the related service one:

{
  "reqId": "XXXXX",
  "level": 3,
  "time": "XXXXX",
  "remoteAddr": "XXXXX",
  "user": "MY_USER",
  "app": "no app in context",
  "method": "GET",
  "url": "/index.php/apps/files/",
  "message": "View service requested: ",
  "userAgent": "XXXXX",
  "version": "25.0.7.1",
  "data": [],
  "id": "XXXXX"
}

All logged views have an empty string root

Voltra avatar Jun 10 '23 11:06 Voltra

Are there multiple messages for the same request id? If explicitly look for all messages of the WebDAV Propfind request.

juliusknorr avatar Jun 10 '23 11:06 juliusknorr

There are a handful, but they're all the same messages: new View: or View service requested:

Voltra avatar Jun 10 '23 11:06 Voltra

Very strange, I cannot see a reason from the code why this would happen.

Maybe to narrow out the DI container, could you check if the following change makes any difference in loading the files list?

diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php
index 2b5661eec63..1db5e51772c 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -101,7 +101,7 @@ abstract class Node implements \Sabre\DAV\INode {
                        $this->node = $info;
                } else {
                        // The Node API assumes that the view passed doesn't have a fake root
-                       $rootView = \OC::$server->get(View::class);
+                       $rootView = new View();
                        $root = \OC::$server->get(IRootFolder::class);
                        if ($info->getType() === FileInfo::TYPE_FOLDER) {
                                $this->node = new Folder($root, $rootView, $this->fileView->getAbsolutePath($this->path), $info);

juliusknorr avatar Jun 13 '23 15:06 juliusknorr

Ok, it might actually be that we don't hit this code path but rather take the node from the $info directly here which should come from https://github.com/nextcloud/server/blob/215aef3cbdc1963be1bb6bca5218ee0a4b7f1665/apps/dav/lib/Files/FilesHome.php#L47

juliusknorr avatar Jun 13 '23 15:06 juliusknorr

Upgrading to 26.0.2 seems to fix the issue as well

Voltra avatar Jun 13 '23 15:06 Voltra

I'm facing the exact same error - Nextcloud is installed via my web provider's and was automatically updated to 25.0.7 a few days ago and the problem started with same symptoms / error logs.

I cannot upgrade to 26 at the moment, due to incompatibility with some apps.

Let me know if there is any additional information I can provide or testing to do.

dregad avatar Jun 14 '23 08:06 dregad

Good morning everyone,

I am facing the same / similiar issue. Allthough it occured when I upgrade to 26.0.2.1 this morning. Basically every DAV requests throws this error (files, calendar, contacts, etc.):

"reqId": "YjafArnfvd3TYDCdGCZp",
"level": 3,
"time": "2023-06-15T07:34:48+00:00",
"remoteAddr": "X.X.X.X",
"user": "USER",
"app": "webdav",
"method": "PROPFIND",
"url": "/remote.php/dav/files/USER/",
"message": "The view passed to the node should not have any fake root set",
"userAgent": "Mozilla/5.0 (Android) Nextcloud-android/3.24.1",
"version": "26.0.2.1",
"exception": {
  "Exception": "OCP\\PreConditionNotMetException",
  "Message": "The view passed to the node should not have any fake root set",
  "Code": 0,
  "Trace": [
    {
      "file": "/usr/local/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php",
      "line": 96,
      "function": "__construct",
      "class": "OC\\Files\\Node\\Node",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
      "line": 77,
      "function": "__construct",
      "class": "OCA\\DAV\\Connector\\Sabre\\Node",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/apps/dav/lib/Files/FilesHome.php",
      "line": 48,
      "function": "__construct",
      "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/apps/dav/lib/Files/RootCollection.php",
      "line": 58,
      "function": "__construct",
      "class": "OCA\\DAV\\Files\\FilesHome",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAVACL/AbstractPrincipalCollection.php",
      "line": 119,
      "function": "getChildForPrincipal",
      "class": "OCA\\DAV\\Files\\RootCollection",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
      "line": 78,
      "function": "getChild",
      "class": "Sabre\\DAVACL\\AbstractPrincipalCollection",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 971,
      "function": "getNodeForPath",
      "class": "Sabre\\DAV\\Tree",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 1662,
      "function": "getPropertiesIteratorForPath",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 1647,
      "function": "writeMultiStatus",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
      "line": 346,
      "function": "generateMultiStatus",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
      "line": 89,
      "function": "httpPropFind",
      "class": "Sabre\\DAV\\CorePlugin",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 472,
      "function": "emit",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 253,
      "function": "invokeMethod",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
      "line": 321,
      "function": "start",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/apps/dav/lib/Server.php",
      "line": 366,
      "function": "exec",
      "class": "Sabre\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/apps/dav/appinfo/v2/remote.php",
      "line": 35,
      "function": "exec",
      "class": "OCA\\DAV\\Server",
      "type": "->"
    },
    {
      "file": "/usr/local/www/nextcloud/remote.php",
      "line": 172,
      "args": [
        "/usr/local/www/nextcloud/apps/dav/appinfo/v2/remote.php"
      ],
      "function": "require_once"
    }
  ],
  "File": "/usr/local/www/nextcloud/lib/private/Files/Node/Node.php",
  "Line": 77,
  "message": "The view passed to the node should not have any fake root set",
  "exception": {},
  "CustomMessage": "The view passed to the node should not have any fake root set"
}

}

If you think this error has another origin, I am happy to provide you more details. But to me it looks like the same issue the OP provided. Thanks for any insights on this one!

TGion avatar Jun 15 '23 07:06 TGion

One think I haven't checked yet is if encryption might have influence on that.

For anyone encountering:

  • Maybe you could also try to apply the patch from https://github.com/nextcloud/server/issues/38723#issuecomment-1585613561 and share the log results from one webdav request here.
  • Share if you are using encryption and if it is with master key or just user keys
  • Share a list of enabled apps so we can check if there are some common bits

juliusknorr avatar Jun 16 '23 10:06 juliusknorr

Good morning, I have some updates. An update to NC 27.0.0 "resolved" the issue. Iam almost certain there hasn't been any changes in this regard. What has changed, are the disabled apps because of the update. So maybe your guess could be right after all, since I dont use any encryption.

Here is my list of disabled apps. Maybe there is some common ground here:

  • breezedark: 26.0.0 (installed 26.0.0)
  • files_texteditor: 2.15.0 (installed 2.15.0)
  • keeweb: 0.6.12 (installed 0.6.12)
  • passman: 2.4.5 (installed 2.4.5)
  • riotchat: 0.15.1 (installed 0.15.1)
  • snappymail: 2.28.1 (installed 2.28.1)

I can later try to enable those one by one, maybe we are lucky and the error shows up again.

TGion avatar Jun 19 '23 06:06 TGion

I can later try to enable those one by one, maybe we are lucky and the error shows up again.

That would definitely be interesting to see if there is any app causing that.

juliusknorr avatar Jun 20 '23 16:06 juliusknorr

I just upgraded to NC 26.0.2 and the problem went away.

For what it's worth, I am not using any of the apps mentioned in https://github.com/nextcloud/server/issues/38723#issuecomment-1596600752.

dregad avatar Jun 21 '23 07:06 dregad

Like @dregad already guessed, enabling those apps didnt't trigger the error:

breezedark: 26.0.0 (installed 26.0.0)
files_texteditor: 2.15.0 (installed 2.15.0)
keeweb: 0.6.12 (installed 0.6.12)
passman: 2.4.5 (installed 2.4.5)
riotchat: 0.15.1 (installed 0.15.1)
snappymail: 2.28.1 (installed 2.28.1)

It's strange that apparently any update fixes the error. Also it introduced the error for myself with an update. A update which fixed the issue for some other user. So maybe there are actions which run while updating which can fix or introduce the error. Pretty wild guess.

TGion avatar Jun 22 '23 13:06 TGion

My guess would rather be that this is then limited to 25, as all reports come from that and 26 fixed it.

juliusknorr avatar Jun 22 '23 13:06 juliusknorr

Allthough it introduced the issue to my installation when I have updated from 26.0.1 to 26.0.2.

TGion avatar Jun 22 '23 14:06 TGion

Closing then, 25 is EOL and 26-27 received changed. 28 Also got a complete overhaul

skjnldsv avatar Oct 21 '23 09:10 skjnldsv