Unable to delete folders and files

Nextcloud version (eg, 20.0.5): 27.0.0.8
Operating system and version (eg, Ubuntu 20.04): Fedora 38
Apache or nginx version (eg, Apache 2.4.25): latest Docker: 27.0.0-apache
PHP version (eg, 7.4): latest Docker: 27.0.0-apache

The issue you are facing:
If I generate a new folder with a new file, I am only able to delete the file, but not the folder. :frowning:
Existing folders and files cannot be delete at all and the button for deletion is not even shown in the web ui.

Is this the first time you’ve seen this error? (Y/N): y

Steps to replicate it:

  1. generate folder and file
  2. try to delelte both
  3. receive error

Files on the disk have the following user and group:
drwxr-xr-x. 5 33 tape 4096 20. Jan 15:37 test folder
drwxr-xr-x. 3 33 tape 4096 19. Aug 2021 another test folder

The user and group were looking weird since ever, which might be a result of using the Nextcloud Docker based deployment?! So if I generate a new folder a file, it is also generated as 33:tape. Therefore I think this looks good, but anyways I am not able to delete folders and files.

The output of your Nextcloud log in Admin > Logging:

[webdav] Fehler: TypeError: 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/Files/Node/Folder.php on line 238 at <<closure>>

 0. /var/www/html/lib/private/Files/Node/Folder.php line 238
    OC\Files\Cache\QuerySearchHelper->getCachesAndMountPointsForSearch(["OC\\Files\\Node\\LazyRoot"], "/test/files/00", false)
 1. /var/www/html/lib/private/Files/Node/Folder.php line 292
    OC\Files\Node\Folder->search(["OC\\Files\\Search\\SearchQuery"])
 2. /var/www/html/custom_apps/music/lib/Utility/Scanner.php line 383
    OC\Files\Node\Folder->searchByMime("audio")
 3. /var/www/html/custom_apps/music/lib/Hooks/FileHooks.php line 42
    OCA\Music\Utility\Scanner->deleteFolder(["OC\\Files\\Node\\Folder"])
 4. <<closure>>
    OCA\Music\Hooks\FileHooks::deleted(["OC\\Files\\Node\\Folder"])
 5. /var/www/html/lib/private/Hooks/EmitterTrait.php line 105
    call_user_func_array(["OCA\\Music\\Ho ... "], [["OC\\Files\\Node\\Folder"]])
 6. /var/www/html/lib/private/Hooks/PublicEmitter.php line 40
    OC\Hooks\BasicEmitter->emit("\\OC\\Files", "preDelete", [["OC\\Files\\Node\\Folder"]])
 7. /var/www/html/lib/private/Files/Node/Root.php line 143
    OC\Hooks\PublicEmitter->emit("\\OC\\Files", "preDelete", [["OC\\Files\\Node\\Folder"]])
 8. <<closure>>
    OC\Files\Node\Root->emit("\\OC\\Files", "preDelete", [["OC\\Files\\Node\\Folder"]])
 9. /var/www/html/lib/private/Files/Node/LazyFolder.php line 73
    call_user_func_array([["OC\\Files\\Node\\Root"],"emit"], ["\\OC\\Files"," ... ]])
10. /var/www/html/lib/private/Files/Node/LazyFolder.php line 101
    OC\Files\Node\LazyFolder->__call("emit", ["\\OC\\Files"," ... ]])
11. /var/www/html/lib/private/Files/Node/HookConnector.php line 145
    OC\Files\Node\LazyFolder->emit("\\OC\\Files", "preDelete", [["OC\\Files\\Node\\Folder"]])
12. /var/www/html/lib/private/legacy/OC_Hook.php line 105
    OC\Files\Node\HookConnector->delete([true,"/00"])
13. /var/www/html/lib/private/Files/View.php line 1252
    OC_Hook::emit("OC_Filesystem", "delete", [true,"/00"])
14. /var/www/html/lib/private/Files/View.php line 1126
    OC\Files\View->runHooks(["delete"], "/00")
15. /var/www/html/lib/private/Files/View.php line 321
    OC\Files\View->basicOperation("rmdir", "/00", ["delete"])
16. /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php line 307
    OC\Files\View->rmdir("/00")
17. /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php line 179
    OCA\DAV\Connector\Sabre\Directory->delete()
18. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 281
    Sabre\DAV\Tree->delete("files/test/00")
19. /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpDelete(["Sabre\\HTTP\\Request"], ["Sabre\\HTTP\\Response"])
20. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit("method:DELETE", [["Sabre\\HTTP\\ ... ]])
21. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod(["Sabre\\HTTP\\Request"], ["Sabre\\HTTP\\Response"])
22. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
23. /var/www/html/apps/dav/lib/Server.php line 364
    Sabre\DAV\Server->exec()
24. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
25. /var/www/html/remote.php line 172
    require_once("/var/www/html/a ... p")

DELETE /remote.php/dav/files/test/00
from 95.88.34.82 by test at 2023-07-04T13:47:50+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => '',
    'port' => 6379,
  ),
  'instanceid' => 'xxx',
  'passwordsalt' => 'D',
  'secret' => '',
  'overwriteprotocol' => 'https',
  'trusted_domains' => 
  array (
    0 => 'tld',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '27.0.0.8',
  'overwrite.cli.url' => 'http://tld',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'xxx',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpport' => '465',
  'mail_from_address' => 'xxx',
  'mail_domain' => 'mnethome.de',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'maintenance' => false,
  'loglevel' => 2,
  'theme' => '',
  'app_install_overwrite' => 
  array (
    0 => 'news',
  ),

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

Log is not loading right now. Any hint how to get the log out of my docker based setup is welcome.

The issue is an interaction with the music app you apparently have installed:

You can disable it temporarily or look in that thread for workarounds until the fix is released officially.

1 Like

@jtr Great, thanks for you answer and the temp. solution.