Can't delete or move empty folder: 500 Internal Server Error

I have discovered a couple of folders in my nextcloud account that can not be deleted or moved. For at least one folder I was able to delete all the files within in, but when I try to delete the folder from a client or from the web interface I get errors like

Server replied "500 Internal Server Error" to "DELETE https:// myserver.io/remote.php/dav/files/me/Music/Perez Prado"

The logs in the web interface give more info (see below)

I thought that maybe this was a permission issue, so I sshed into the server and looked at the folder permissions and ownership, but they were the same as all the other folders. I rebooted the entire system, but there was no change. I probably could just delete the files from the terminal, but I am worried that this would corrupt the database somehow.

Does anyone have any ideas on how to debug this?

Nextcloud version : 26.0.2
Operating system and version : Ubuntu Linux 22.04.2
Apache or nginx version: Apache2
PHP version : 8.1.2

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/nextcloud/lib/private/Files/Node/Folder.php on line 237

    /var/www/nextcloud/lib/private/Files/Node/Folder.php - line 237:

    OC\Files\Cache\QuerySearchHelper->getCachesAndMountPointsForSearch()

    /var/www/nextcloud/lib/private/Files/Node/Folder.php - line 291:

    OC\Files\Node\Folder->search()

    /var/www/nextcloud/apps/music/lib/Utility/Scanner.php - line 383:

    OC\Files\Node\Folder->searchByMime()

    /var/www/nextcloud/apps/music/lib/Hooks/FileHooks.php - line 42:

    OCA\Music\Utility\Scanner->deleteFolder()

    <<closure>>

    OCA\Music\Hooks\FileHooks::deleted()

    /var/www/nextcloud/lib/private/Hooks/EmitterTrait.php - line 105:

    call_user_func_array()

    /var/www/nextcloud/lib/private/Hooks/PublicEmitter.php - line 40:

    OC\Hooks\BasicEmitter->emit()

    /var/www/nextcloud/lib/private/Files/Node/Root.php - line 143:

    OC\Hooks\PublicEmitter->emit()

    <<closure>>

    OC\Files\Node\Root->emit()

    /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php - line 72:

    call_user_func_array()

    /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php - line 100:

    OC\Files\Node\LazyFolder->__call()

    /var/www/nextcloud/lib/private/Files/Node/HookConnector.php - line 145:

    OC\Files\Node\LazyFolder->emit()

    /var/www/nextcloud/lib/private/legacy/OC_Hook.php - line 105:

    OC\Files\Node\HookConnector->delete()

    /var/www/nextcloud/lib/private/Files/View.php - line 1295:

    OC_Hook::emit()

    /var/www/nextcloud/lib/private/Files/View.php - line 1165:

    OC\Files\View->runHooks()

    /var/www/nextcloud/lib/private/Files/View.php - line 351:

    OC\Files\View->basicOperation()

    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 307:

    OC\Files\View->rmdir()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179:

    OCA\DAV\Connector\Sabre\Directory->delete()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 281:

    Sabre\DAV\Tree->delete()

    /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

    Sabre\DAV\CorePlugin->httpDelete()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:

    Sabre\DAV\Server->emit()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

    Sabre\DAV\Server->invokeMethod()

    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

    Sabre\DAV\Server->start()

    /var/www/nextcloud/apps/dav/lib/Server.php - line 366:

    Sabre\DAV\Server->exec()

    /var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

    OCA\DAV\Server->exec()

    /var/www/nextcloud/remote.php - line 172:

    require_once("/var/www/ne ... p")

I assume you meant to type v26.0.2.

Can you confirm two things:

  • You’re running the latest version of the Music app (v1.8.4) and, if not, update it and see if this issue still occurs
  • If still happening (or already running 1.8.4), can you disable the app and see if the issue goes away?

In any case, I believe you may be encountering this:

2 Likes

I have Music 1.8.4 installed, but never use it. Disabling it fixes the problem !

3 Likes

Hi all.

Confirm 27.0.0 version has the same issue.
Disabling the Music app plugin the issue ends.

Greetings
JP