nextcloud/impersonate

($root) must be of type {Parameter}, {Parameter} given

Closed this issue · 2 comments

Error:($root) must be of type OC\Files\Node\Root, OC\Files\Node\LazyRoot given

I want to delete/move a directory and it prompted this exception
But files can be deleted/moved normally

error log:
{"reqId":"Q6ijovgRsFf9oC2B3fkG","level":3,"time":"2023-07-17T01:59:41+00:00","remoteAddr":"172.17.0.1","user":"Dark","app":"webdav","method":"DELETE","url":"/remote.php/dav/files/Dark/Test","message":"OC\\Files\\Cache\\QuerySearchHelper::getCachesAndMountPointsForSearch(): Argument #1 ($root) must be of type OC\\Files\\Node\\Root, OC\\Files\\Node\\LazyRoot given, called in /var/www/html/lib/private/Filesde/Folder.php on line 238","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36","version":"27.0.0.8","exception":{"Exception":"TypeError","Message":"OC\\Files\\Cache\\QuerySearchHelper::getCachesAndMountPointsForSearch(): Argument #1 ($root) must be of type OC\\Files\\Node\\Root, OC\\Files\\Node\\LazyRoot given, called in /var/www/html/lib/private/Filesde/Folder.php on line 238","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Filesde/Folder.php","line":238,"function":"getCachesAndMountPointsForSearch","class":"OC\\Files\\Cache\\QuerySearchHelper","type":"->","args":[["OC\\Files\\Node\\LazyRoot"],"/Dark/files/Test",false]},{"file":"/var/www/html/lib/private/Filesde/Folder.php","line":292,"function":"search","class":"OC\\Files\\Node\\Folder","type":"->","args":[["OC\\Files\\Search\\SearchQuery"]]},{"file":"/var/www/html/custom_apps/music/lib/Utility/Scanner.php","line":383,"function":"searchByMime","class":"OC\\Files\\Node\\Folder","type":"->","args":["audio"]},{"file":"/var/www/html/custom_apps/music/lib/Hooks/FileHooks.php","line":42,"function":"deleteFolder","class":"OCA\\Music\\Utility\\Scanner","type":"->","args":[["OC\\Files\\Node\\Folder"]]},{"function":"deleted","class":"OCA\\Music\\Hooks\\FileHooks","type":"::","args":[["OC\\Files\\Node\\Folder"]]},{"file":"/var/www/html/lib/private/Hooks/EmitterTrait.php","line":105,"function":"call_user_func_array","args":[["OCA\\Music\\Hooks\\FileHooks","deleted"],[["OC\\Files\\Node\\Folder"]]]},{"file":"/var/www/html/lib/private/Hooks/PublicEmitter.php","line":40,"function":"emit","class":"OC\\Hooks\\BasicEmitter","type":"->","args":["\\OC\\Files","preDelete",[["OC\\Files\\Node\\Folder"]]]},{"file":"/var/www/html/lib/private/Filesde/Root.php","line":143,"function":"emit","class":"OC\\Hooks\\PublicEmitter","type":"->","args":["\\OC\\Files","preDelete",[["OC\\Files\\Node\\Folder"]]]},{"function":"emit","class":"OC\\Files\\Node\\Root","type":"->","args":["\\OC\\Files","preDelete",[["OC\\Files\\Node\\Folder"]]]},{"file":"/var/www/html/lib/private/Filesde/LazyFolder.php","line":73,"function":"call_user_func_array","args":[[["OC\\Files\\Node\\Root"],"emit"],["\\OC\\Files","preDelete",[["OC\\Files\\Node\\Folder"]]]]},{"file":"/var/www/html/lib/private/Filesde/LazyFolder.php","line":101,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["emit",["\\OC\\Files","preDelete",[["OC\\Files\\Node\\Folder"]]]]},{"file":"/var/www/html/lib/private/Filesde/HookConnector.php","line":145,"function":"emit","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["\\OC\\Files","preDelete",[["OC\\Files\\Node\\Folder"]]]},{"file":"/var/www/html/lib/private/legacy/OC_Hook.php","line":105,"function":"delete","class":"OC\\Files\\Node\\HookConnector","type":"->","args":[[true,"/Test"]]},{"file":"/var/www/html/lib/private/Files/View.php","line":1252,"function":"emit","class":"OC_Hook","type":"::","args":["OC_Filesystem","delete",[true,"/Test"]]},{"file":"/var/www/html/lib/private/Files/View.php","line":1126,"function":"runHooks","class":"OC\\Files\\View","type":"->","args":[["delete"],"/Test"]},{"file":"/var/www/html/lib/private/Files/View.php","line":321,"function":"basicOperation","class":"OC\\Files\\View","type":"->","args":["rmdir","/Test",["delete"]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":307,"function":"rmdir","class":"OC\\Files\\View","type":"->","args":["/Test"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":179,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":[]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->","args":["files/Dark/Test"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:DELETE",[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":364,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":172,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Files/Cache/QuerySearchHelper.php","Line":201,"message":"OC\\Files\\Cache\\QuerySearchHelper::getCachesAndMountPointsForSearch(): Argument #1 ($root) must be of type OC\\Files\\Node\\Root, OC\\Files\\Node\\LazyRoot given, called in /var/www/html/lib/private/Filesde/Folder.php on line 238","exception":{},"CustomMessage":"OC\\Files\\Cache\\QuerySearchHelper::getCachesAndMountPointsForSearch(): Argument #1 ($root) must be of type OC\\Files\\Node\\Root, OC\\Files\\Node\\LazyRoot given, called in /var/www/html/lib/private/Filesde/Folder.php on line 238"}}

That might have been issue on the server, i recall something about it. If you upgraded your instanced, does this still happen?

no,i stop music app and remove it,and it works.My nextcolud version 27.0.0