server
server copied to clipboard
[Bug]: Moved multiple folders on the web portal, now they are empty.
⚠️ This issue respects the following points: ⚠️
- [X] This is a bug, not a question or a configuration/webserver/proxy issue.
- [X] This issue is not already reported on Github (I've searched it).
- [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- [X] Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- [X] I agree to follow Nextcloud's Code of Conduct.
Bug description
Just updated to Nextcloud 26. However, I noticed that my desktop client was not syncing /documents. It stated that the folder was too big or on external storage; however, it was only 1.6 GB total. I believe I ran into this issue where Nextcloud desktop clients stop syncing due to more than 100 subfolders, but fail to tell the user this is the issue. However, that is not why I am reporting an issue here.
I began moving subfolders out of /documents and to their own folder in the / root folder. This enabled the /documents folder to begin syncing again. I estimate that I moved about 12 folders, but each folder probably had multiple subfolders.
However, every folder that I moved to / is now empty. There are no files at all, and the folder size is 0 b.
The log states:
Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
I have backups, but I will have to reupload these to Nextcloud for the server to recognize the files. Is there any way to avoid this destruction of files issue in the future?
Steps to reproduce
- Move multiple folders in the web client
- Check new folder locations
Expected behavior
All folders and files will be moved successfully.
Installation method
Community Docker image
Nextcloud Server version
26
Operating system
Debian/Ubuntu
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- [ ] Default user-backend (database)
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
Configuration report
No response
List of activated Apps
Only default apps installed.
Nextcloud Signing status
No response
Nextcloud Logs
Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1814:
Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1749:
Doctrine\DBAL\Connection->handleDriverException()
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1163:
Doctrine\DBAL\Connection->convertExceptionDuringQuery()
/config/www/nextcloud/lib/private/DB/Connection.php - line 297:
Doctrine\DBAL\Connection->executeStatement()
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:
OC\DB\Connection->executeStatement()
/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 280:
Doctrine\DBAL\Query\QueryBuilder->execute()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 384:
OC\DB\QueryBuilder\QueryBuilder->execute()
/config/www/nextcloud/lib/private/Files/Cache/HomeCache.php - line 72:
OC\Files\Cache\Cache->update("*** sensiti ... *")
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 824:
OC\Files\Cache\HomeCache->calculateFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 836:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 836:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Updater.php - line 219:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/apps/files_trashbin/lib/Trashbin.php - line 316:
OC\Files\Cache\Updater->renameFromStorage()
/config/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php - line 107:
OCA\Files_Trashbin\Trashbin::move2trash()
/config/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php - line 102:
OCA\Files_Trashbin\Trash\LegacyTrashBackend->moveToTrash()
/config/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 202:
OCA\Files_Trashbin\Trash\TrashManager->moveToTrash()
/config/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 102:
OCA\Files_Trashbin\Storage->doDelete()
/config/www/nextcloud/lib/private/Files/View.php - line 1182:
OCA\Files_Trashbin\Storage->unlink()
/config/www/nextcloud/lib/private/Files/View.php - line 729:
OC\Files\View->basicOperation()
/config/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 534:
OC\Files\View->unlink()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179:
OCA\DAV\Connector\Sabre\File->delete()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 281:
Sabre\DAV\Tree->delete()
/config/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpDelete()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:
Sabre\DAV\Server->emit()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:
Sabre\DAV\Server->invokeMethod()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:
Sabre\DAV\Server->start()
/config/www/nextcloud/apps/dav/lib/Server.php - line 366:
Sabre\DAV\Server->exec()
/config/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:
OCA\DAV\Server->exec()
/config/www/nextcloud/remote.php - line 171:
require_once("/config/www ... p")
Caused by Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 103:
Doctrine\DBAL\Driver\PDO\Exception::new()
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1153:
Doctrine\DBAL\Driver\PDO\Statement->execute()
/config/www/nextcloud/lib/private/DB/Connection.php - line 297:
Doctrine\DBAL\Connection->executeStatement()
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:
OC\DB\Connection->executeStatement()
/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 280:
Doctrine\DBAL\Query\QueryBuilder->execute()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 384:
OC\DB\QueryBuilder\QueryBuilder->execute()
/config/www/nextcloud/lib/private/Files/Cache/HomeCache.php - line 72:
OC\Files\Cache\Cache->update("*** sensiti ... *")
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 824:
OC\Files\Cache\HomeCache->calculateFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 836:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 836:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Updater.php - line 219:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/apps/files_trashbin/lib/Trashbin.php - line 316:
OC\Files\Cache\Updater->renameFromStorage()
/config/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php - line 107:
OCA\Files_Trashbin\Trashbin::move2trash()
/config/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php - line 102:
OCA\Files_Trashbin\Trash\LegacyTrashBackend->moveToTrash()
/config/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 202:
OCA\Files_Trashbin\Trash\TrashManager->moveToTrash()
/config/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 102:
OCA\Files_Trashbin\Storage->doDelete()
/config/www/nextcloud/lib/private/Files/View.php - line 1182:
OCA\Files_Trashbin\Storage->unlink()
/config/www/nextcloud/lib/private/Files/View.php - line 729:
OC\Files\View->basicOperation()
/config/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 534:
OC\Files\View->unlink()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179:
OCA\DAV\Connector\Sabre\File->delete()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 281:
Sabre\DAV\Tree->delete()
/config/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpDelete()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:
Sabre\DAV\Server->emit()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:
Sabre\DAV\Server->invokeMethod()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:
Sabre\DAV\Server->start()
/config/www/nextcloud/apps/dav/lib/Server.php - line 366:
Sabre\DAV\Server->exec()
/config/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:
OCA\DAV\Server->exec()
/config/www/nextcloud/remote.php - line 171:
require_once("/config/www ... p")
Caused by PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 101:
PDOStatement->execute()
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1153:
Doctrine\DBAL\Driver\PDO\Statement->execute()
/config/www/nextcloud/lib/private/DB/Connection.php - line 297:
Doctrine\DBAL\Connection->executeStatement()
/config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:
OC\DB\Connection->executeStatement()
/config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 280:
Doctrine\DBAL\Query\QueryBuilder->execute()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 384:
OC\DB\QueryBuilder\QueryBuilder->execute()
/config/www/nextcloud/lib/private/Files/Cache/HomeCache.php - line 72:
OC\Files\Cache\Cache->update("*** sensiti ... *")
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 824:
OC\Files\Cache\HomeCache->calculateFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 836:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Cache.php - line 836:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/lib/private/Files/Cache/Updater.php - line 219:
OC\Files\Cache\Cache->correctFolderSize()
/config/www/nextcloud/apps/files_trashbin/lib/Trashbin.php - line 316:
OC\Files\Cache\Updater->renameFromStorage()
/config/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php - line 107:
OCA\Files_Trashbin\Trashbin::move2trash()
/config/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php - line 102:
OCA\Files_Trashbin\Trash\LegacyTrashBackend->moveToTrash()
/config/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 202:
OCA\Files_Trashbin\Trash\TrashManager->moveToTrash()
/config/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 102:
OCA\Files_Trashbin\Storage->doDelete()
/config/www/nextcloud/lib/private/Files/View.php - line 1182:
OCA\Files_Trashbin\Storage->unlink()
/config/www/nextcloud/lib/private/Files/View.php - line 729:
OC\Files\View->basicOperation()
/config/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 534:
OC\Files\View->unlink()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179:
OCA\DAV\Connector\Sabre\File->delete()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 281:
Sabre\DAV\Tree->delete()
/config/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpDelete()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:
Sabre\DAV\Server->emit()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:
Sabre\DAV\Server->invokeMethod()
/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:
Sabre\DAV\Server->start()
/config/www/nextcloud/apps/dav/lib/Server.php - line 366:
Sabre\DAV\Server->exec()
/config/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:
OCA\DAV\Server->exec()
/config/www/nextcloud/remote.php - line 171:
require_once("/config/www ... p")
Additional info
.
1st, on disk, are the files on the folders?
If yes, does occ files:scan --all
help?
@solracsf no they were not on disk, I ssh'd into the machine and checked. I then restored from a backup - restoring to a different location just in case, and then ran occ files:scan --all which found the restored files but not the originals.
I believe what is occuring during the move is this:
- I initiate the command to move multiple folders in the web portal
- Nextcloud creates all the destination folders
- Nextcloud proceeds to write the new files but hits the Deadlock Exception and cannot write the new files
- Nextcloud then removes the old folders and their contents.
- The new folders now exist but have no files inside them.
I am kinda curious if my issue is due to my particular server not being able to support concurrent moves without hitting an error in the database. However, I have plenty of RAM and CPU.
Hi, there have been patches to address this issue that will land in 26.0.3. Can you please verify if 26.0.3-rc1 improves the situation around this issue?
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.