Error when deleting file from Linux desktop client

Hi dear community,

I get a “fatal error” when I delete files in the Nextcloud desktop client (Linux, Ubuntu). Any ideas what might be wrong? Running Nextcloud 19.0.3 in Docker.

It looks like this:

[webdav] Fatal: Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing ‘UPDATE oc_filecache SET size = ? WHERE (fileid = ?) AND ((size <> ?) OR (size IS NULL))’ with params [202704267200, 68139, 202704267200]:

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at <>

  1. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169
    Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(“An exception oc … n”, Doctrine\DBAL\Dr … ]})
  2. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 145
    Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr … ]}, “An exception oc … n”)
  3. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1063
    Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr … ]}, “UPDATE `oc_file … )”, {1: 202704267200 … 0})
  4. /var/www/html/lib/private/DB/Connection.php line 214
    Doctrine\DBAL\Connection->executeUpdate(“UPDATE `oc_file … )”, [202704267200,"* … 0], [2,1,2])
  5. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 203
    OC\DB\Connection->executeUpdate(“UPDATE `oc_file … )”, {dcValue1: "*** … 0}, {dcValue1: 1,dcValue2: 2,dcValue3: 2})
  6. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 216
    Doctrine\DBAL\Query\QueryBuilder->execute()
  7. /var/www/html/lib/private/Files/Cache/Cache.php line 363
    OC\DB\QueryBuilder\QueryBuilder->execute()
  8. /var/www/html/lib/private/Files/Cache/Cache.php line 898
    OC\Files\Cache\Cache->update(“*** sensitive parameters replaced ***”)
  9. /var/www/html/lib/private/Files/Cache/HomeCache.php line 43
    OC\Files\Cache\Cache->calculateFolderSize(“files/Pictures/ … r”, OC\Files\Cache\CacheEntry {})
  10. /var/www/html/lib/private/Files/Cache/Cache.php line 830
    OC\Files\Cache\HomeCache->calculateFolderSize(“files/Pictures/ … r”, null)
  11. /var/www/html/lib/private/Files/Cache/Cache.php line 842
    OC\Files\Cache\Cache->correctFolderSize(“files/Pictures/ … r”)
  12. /var/www/html/lib/private/Files/Cache/Cache.php line 842
    OC\Files\Cache\Cache->correctFolderSize(“files/Pictures/ … n”)
  13. /var/www/html/lib/private/Files/Cache/Updater.php line 217
    OC\Files\Cache\Cache->correctFolderSize(“files/Pictures/ … 4”)
  14. /var/www/html/apps/files_trashbin/lib/Trashbin.php line 289
    OC\Files\Cache\Updater->renameFromStorage(OCA\Files_Trashb … }}, “files/Pictures/ … 4”, “files_trashbin/ … 7”)
  15. /var/www/html/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php line 108
    OCA\Files_Trashbin\Trashbin::move2trash(“Pictures/2019/( … 4”)
  16. /var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php line 103
    OCA\Files_Trashbin\Trash\LegacyTrashBackend->moveToTrash(OCA\Files_Trashb … }}, “files/Pictures/ … 4”)
  17. /var/www/html/apps/files_trashbin/lib/Storage.php line 192
    OCA\Files_Trashbin\Trash\TrashManager->moveToTrash(OCA\Files_Trashb … }}, “files/Pictures/ … 4”)
  18. /var/www/html/apps/files_trashbin/lib/Storage.php line 99
    OCA\Files_Trashbin\Storage->doDelete(“files/Pictures/ … 4”, “unlink”)
  19. /var/www/html/lib/private/Files/View.php line 1161
    OCA\Files_Trashbin\Storage->unlink(“files/Pictures/ … 4”)
  20. /var/www/html/lib/private/Files/View.php line 718
    OC\Files\View->basicOperation(“unlink”, “/Pictures/2019/ … 4”, [“delete”])
  21. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 458
    OC\Files\View->unlink(“/Pictures/2019/ … 4”)
  22. /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php line 183
    OCA\DAV\Connector\Sabre\File->delete()
  23. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 295
    Sabre\DAV\Tree->delete(“files/benjamin/ … 4”)
  24. /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpDelete(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
  25. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 474
    Sabre\DAV\Server->emit(“method:DELETE”, [Sabre\HTTP\Requ … }])
  26. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 251
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
  27. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 319
    Sabre\DAV\Server->start()
  28. /var/www/html/apps/dav/lib/Server.php line 320
    Sabre\DAV\Server->exec()
  29. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
  30. /var/www/html/remote.php line 167
    require_once(“/var/www/html/a … p”)

DELETE /remote.php/dav/files/benjamin/Pictures/2019/(2019-08-01)%20Dreamtrip%202019/GoPro/L%C3%A4nder/5%20Italien/GOPR9670.MP4
from 172.18.0.2 by benjamin at 2020-10-19T09:09:37+00:00

Hei benis,
maybe the file is locked. Did you try to unlock?

Hi @floa,
How do I do that? Unlock a file I mean?

In your database, there is a table oc_file_lock
Delete all entries with value lock that are not 0
Easiest way is to use phpmyadmin (but you can also use SQL CLI when you have ssh access to your server)
This is the SQL command:

DELETE FROM `nextcloud`.`oc_file_locks` WHERE `oc_file_locks`.`lock` != 0;

Make sure you have the ; at the end of the line

Tell me if you need help with phpmyadmin or SQL CLI

Thanks again!

I look in the database (using DBeaver) and no locked files what I can see:
Screenshot from 2020-10-19 17-08-50

Just four rows and nothing “1” under “lock” column.

I will monitor this table when deleting a lot of files (10+).

ok, that seems not to be the case for your problem.

What happens if you try to delete the file in the webinterface of your nextcloud instance?

If you cannot delete the file there too, next step you can try to find the file you want to delete in your data directory in the server and delete it manually there.
After that, run “occ files:scan --path=”

It seems like I can delete files - my “only” issue is the errors in the log. Weird I think?

yeah, really weired. so i am sorry, i cannot help here any further.
Maybe another member can read your log in a more precise way then i do.

1 Like