-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore from trashbin triggers CacheQueryBuilder::whereFileId() Fatal error #1218
Comments
@acsfer did you find a workaround? We just experienced the same :) the restore is a pain :) |
@acsfer did you try without s3? On one of our try, we could actually restore (there was the error message, but the restore did succeed). |
I believe that this happens only with some implementations of S3 but not with AWS S3. There is a recent issue about it nextcloud/server#25946 |
The query to restore in the mean time:
|
I don't think it is related, but it is an interesting bug indeed that I'll follow closely. |
I took a look at the source code and did some testing and the issues seems to come from : groupfolders/lib/Trash/TrashBackend.php Lines 150 to 151 in e668887
My understanding is that the cache (aka the database) :
The problem with s3 is that the cache has already been updated after the first operation and naturally the second operation can't find the old field id. A quick fix would be to comment the second line when you're using s3 as primary storage. To really fix this we could add some conditional logic, but it means keeping up to date a list of strictly consistent storage. |
On my case, the restore actually works, but it prints an error to the user. |
tl;dr
Reproduce case outside Group Folders on the same environment works.
Env
Reproduce
Log Messages
``` { "reqId": "0P3singiqHu88qAk7VRF", "level": 4, "time": "2021-01-06T15:01:05+01:00", "app": "webdav", "method": "MOVE", "url": "/remote.php/dav/trashbin/user/trash/2.%20Product%20Datasheets.d1609877680", "message": { "Exception": "TypeError", "Message": "Argument 1 passed to OC\\Files\\Cache\\CacheQueryBuilder::whereFileId() must be of the type int, null given, called in /lib/private/Files/Cache/Cache.php on line 676", "Code": 0, "Trace": [ { "file": "/lib/private/Files/Cache/Cache.php", "line": 676, "function": "whereFileId", "class": "OC\\Files\\Cache\\CacheQueryBuilder", "type": "->", "args": [ null ] }, { "file": "/apps/groupfolders/lib/Trash/TrashBackend.php", "line": 147, "function": "moveFromCache", "class": "OC\\Files\\Cache\\Cache", "type": "->", "args": [ { "__class__": "OC\\Files\\Cache\\Cache" }, "__groupfolders/trash/3/2. Product Datasheets.d1609941656", "__groupfolders/3/2. Product Datasheets" ] }, { "file": "/apps/files_trashbin/lib/Trash/TrashManager.php", "line": 65, "function": "restoreItem", "class": "OCA\\GroupFolders\\Trash\\TrashBackend", "type": "->", "args": [ { "__class__": "OCA\\GroupFolders\\Trash\\GroupTrashItem" } ] }, { "file": "/apps/files_trashbin/lib/Sabre/AbstractTrash.php", "line": 94, "function": "restoreItem", "class": "OCA\\Files_Trashbin\\Trash\\TrashManager", "type": "->", "args": [ { "__class__": "OCA\\GroupFolders\\Trash\\GroupTrashItem" } ] }, { "file": "/apps/files_trashbin/lib/Sabre/RestoreFolder.php", "line": 76, "function": "restore", "class": "OCA\\Files_Trashbin\\Sabre\\AbstractTrash", "type": "->", "args": [] }, { "file": "/3rdparty/sabre/dav/lib/DAV/Tree.php", "line": 164, "function": "moveInto", "class": "OCA\\Files_Trashbin\\Sabre\\RestoreFolder", "type": "->", "args": [ "2. Product Datasheets.d1609877680", "trashbin/user/trash/2. Product Datasheets.d1609877680", { "__class__": "OCA\\Files_Trashbin\\Sabre\\TrashFolder" } ] }, { "file": "/3rdparty/sabre/dav/lib/DAV/CorePlugin.php", "line": 641, "function": "move", "class": "Sabre\\DAV\\Tree", "type": "->", "args": [ "trashbin/user/trash/2. Product Datasheets.d1609877680", "trashbin/user/restore/2. Product Datasheets.d1609877680" ] }, { "file": "/3rdparty/sabre/event/lib/WildcardEmitterTrait.php", "line": 89, "function": "httpMove", "class": "Sabre\\DAV\\CorePlugin", "type": "->", "args": [ { "__class__": "Sabre\\HTTP\\Request" }, { "__class__": "Sabre\\HTTP\\Response" } ] }, { "file": "/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 474, "function": "emit", "class": "Sabre\\DAV\\Server", "type": "->", "args": [ "method:MOVE", [ { "__class__": "Sabre\\HTTP\\Request" }, { "__class__": "Sabre\\HTTP\\Response" } ] ] }, { "file": "/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 251, "function": "invokeMethod", "class": "Sabre\\DAV\\Server", "type": "->", "args": [ { "__class__": "Sabre\\HTTP\\Request" }, { "__class__": "Sabre\\HTTP\\Response" } ] }, { "file": "/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 319, "function": "start", "class": "Sabre\\DAV\\Server", "type": "->", "args": [] }, { "file": "/apps/dav/lib/Server.php", "line": 332, "function": "exec", "class": "Sabre\\DAV\\Server", "type": "->", "args": [] }, { "file": "/apps/dav/appinfo/v2/remote.php", "line": 35, "function": "exec", "class": "OCA\\DAV\\Server", "type": "->", "args": [] }, { "file": "/remote.php", "line": 167, "args": [ "/apps/dav/appinfo/v2/remote.php" ], "function": "require_once" } ], "File": "/lib/private/Files/Cache/CacheQueryBuilder.php", "Line": 66, "CustomMessage": "--" }, "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36", "version": "20.0.4.0", "id": "5ff5c2b28a0e3" } ```The text was updated successfully, but these errors were encountered: