Cannot delete folders (even empty) after migration from OC to Nextcloud snap

Hi everyone,

I’ve migrated from an ownCloud 9.1.4 to Nextcloud 11.0.1. For ownCloud, I had used the Debian packages supplied via the SuSE repos and for Nextcloud I’m using the Snap.

The migration consisted of copying over the database and data directory and everything went quite well.

The only problem I’m facing currently is that I cannot delete folders in Nextcloud. Whenever I try to delete a folder, I see the error message “Error deleting file ‘…’”. The JS console in Chrome says that the DELETE request is answered with an HTTP error code of 500 Internal Server Error.

I cannot delete folders via the sync client either. They will just re-appear after the next sync.

Deleting files works fine though.

It happens with both old folders (present before the migration) and new folders (created after the migration).

Looking at the nextcloud.log I see two different kinds of error messages:

Message 1:

{"reqId":"IJ88q6k9sz39gTPeTcOq","remoteAddr":"1.2.3.4","app":"PHP","message":"Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) at \/snap\/nextcloud\/862\/htdocs\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php#104","level":3,"time":"2017-03-01T02:09:28+00:00","method":"DELETE","url":"\/remote.php\/webdav\/path%20to%20my\/folder","user":"foo","version":"11.0.1.2"}

Message 2:

{"reqId":"bMhWc53gZ7Xbp4\/Mj6WF","remoteAddr":"1.2.3.4","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 423 \\\"foo\\\/far\\\" is locked\",\"Exception\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Exception\\\\FileLocked\",\"Code\":0,\"Trace\":\"#0 \\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(179): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->delete()\\n#1 \\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(287): Sabre\\\\DAV\\\\Tree->delete('foo\\\/bar')\\n#2 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#3 \\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#4 \\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)\\n#5 \\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(60): Sabre\\\\DAV\\\\Server->exec()\\n#7 \\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/remote.php(165): require_once('\\\/snap\\\/nextcloud...')\\n#8 {main}\",\"File\":\"\\\/snap\\\/nextcloud\\\/862\\\/htdocs\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php\",\"Line\":284,\"User\":\"foo\"}","level":4,"time":"2017-03-01T02:09:30+00:00","method":"DELETE","url":"\/remote.php\/webdav\/foo\/bar","user":"foo","version":"11.0.1.2"}

I’ve already double checked file permissions: all files belong to root:root (which is how the snap does it) and have rw on files and rwx on folders for the owner.

I cannot change the php memory limit because my php.ini is mounted read-only from a squashfs which is how the snap does it. However, it seems odd that I would run out of memory when deleting a simple empty folder. So I assume it would run out of memory even if I raised the limit.

Also, afaik the Nextcloud snap is using Redis as a locking store, so I’ve already tried flushing Redis using flushall (installed the redis cli and connected using the socket). FWIW, my oc_file_locks table is also empty.

I would be grateful for any ideas or pointers. Thanks!

I have a similar issue. Did you solve your problem?

I solved the problem now by upgrading to version 14.0.0