Closed solracsf closed 3 years ago
Same issue here. Object Storage via S3.
Same Error with a nearly identical setup
MOVE /remote.php/dav/uploads/u221219/web-file-upload-360dc11ec3f6b727dccf1f21382d298b-1579507080603/.file
is related to assembly a file uploaded in chunks. I don't know how to reproduce that kind of failure. Uploading files in chunks with s3 (minio) works with my development setup.
$sourceData
could be false. Probably a check is missing here. But the actual error is happening earlier.
6. /srv/apps/dav/lib/Connector/Sabre/Directory.php line 156
OCA\DAV\Connector\Sabre\File->put(null)
7. /srv/3rdparty/sabre/dav/lib/DAV/Tree.php line 316
OCA\DAV\Connector\Sabre\Directory->createFile("DSC_0073.jpg", null)
8. /srv/3rdparty/sabre/dav/lib/DAV/Tree.php line 130
Sabre\DAV\Tree->copyNode(OCA\DAV\Upload\FutureFile {}, OCA\DAV\Connector\Sabre\Directory {}, "DSC_0073.jpg")
It seems that $data is null.
$data = $source->get();
returns null.
cc @rullzer @icewind1991
For the record, i'm able to reproduce it every time with this test case:
1 file uploaded, 4 errors
And in the logfile 4 lines like:
Error: TypeError: Argument 1 passed to OC\Files\Cache\CacheQueryBuilder::whereFileId() must be of the type int, null given, called in /srv/lib/private/Files/Cache/Cache.php on line 655
I can consistently repro this issue, but with a different test case. Same specs as @acsfer
[index] Error: TypeError: Argument 1 passed to OC\Files\Cache\CacheQueryBuilder::whereFileId() must be of the type integer, null given, called in /var/www/nextcloud/lib/private/Files/Cache/Cache.php on line 655 at <<closure>>
0. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 655
OC\Files\Cache\CacheQueryBuilder->whereFileId(null)
1. /var/www/nextcloud/lib/private/Files/Cache/Cache.php line 579
OC\Files\Cache\Cache->moveFromCache(OC\Files\Cache\Cache {}, "appdata_ochey15 ... t", "appdata_ochey15 ... s")
2. /var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php line 476
OC\Files\Cache\Cache->move("appdata_ochey15 ... t", "appdata_ochey15 ... s")
3. /var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php line 400
OC\Files\ObjectStore\ObjectStoreStorage->writeStream("appdata_ochey15 ... s", null, 1)
4. /var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php line 313
OC\Files\ObjectStore\ObjectStoreStorage->writeBack("/tmp/oc_tmp_mwn3YU-.css", "appdata_ochey15 ... s")
5. <<closure>>
OC\Files\ObjectStore\ObjectStoreStorage->OC\Files\ObjectStore\{closure}("*** sensitive parameters replaced ***")
6. /var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php line 121
call_user_func(Closure {})
7. <<closure>>
Icewind\Streams\CallbackWrapper->stream_close()
8. /var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php line 421
fclose(null)
9. /var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php line 376
OC\Files\ObjectStore\ObjectStoreStorage->file_put_contents("appdata_ochey15 ... s", " ")
10. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 354
OC\Files\ObjectStore\ObjectStoreStorage->touch("appdata_ochey15 ... s", 1589427415)
11. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php line 364
OC\Files\Storage\Wrapper\Wrapper->touch("appdata_ochey15 ... s", null)
12. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 354
OC\Files\Storage\Wrapper\Availability->touch("appdata_ochey15 ... s", null)
13. /var/www/nextcloud/lib/private/Files/View.php line 1162
OC\Files\Storage\Wrapper\Wrapper->touch("appdata_ochey15 ... s")
14. /var/www/nextcloud/lib/private/Files/View.php line 569
OC\Files\View->basicOperation("touch", "/appdata_ochey1 ... s", ["touch","create","write"], null)
15. /var/www/nextcloud/lib/private/Files/Node/Folder.php line 184
OC\Files\View->touch("/appdata_ochey1 ... s")
16. /var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php line 84
OC\Files\Node\Folder->newFile("47cd-aef3-globalstyles.css")
17. /var/www/nextcloud/lib/private/Template/SCSSCacher.php line 312
OC\Files\SimpleFS\SimpleFolder->newFile("47cd-aef3-globalstyles.css")
18. /var/www/nextcloud/lib/private/Template/SCSSCacher.php line 182
OC\Template\SCSSCacher->cache("/var/www/nextcloud/apps/deck/css", "47cd-aef3-globalstyles.css", "globalstyles.scss", OC\Files\SimpleFS\SimpleFolder {}, "/apps/deck/css")
19. /var/www/nextcloud/lib/private/Template/CSSResourceLocator.php line 110
OC\Template\SCSSCacher->process("/var/www/nextcloud/apps/deck", "css/globalstyles.scss", "deck")
20. /var/www/nextcloud/lib/private/Template/CSSResourceLocator.php line 85
OC\Template\CSSResourceLocator->cacheAndAppendScssIfExist("/var/www/nextcloud/apps/deck", "css/globalstyles.scss", "deck")
21. /var/www/nextcloud/lib/private/Template/ResourceLocator.php line 78
OC\Template\CSSResourceLocator->doFind("css/globalstyles")
22. /var/www/nextcloud/lib/private/TemplateLayout.php line 310
OC\Template\ResourceLocator->find(["css/server","c ... "])
23. /var/www/nextcloud/lib/private/TemplateLayout.php line 215
OC\TemplateLayout::findStylesheetFiles(["css/server","c ... "])
24. /var/www/nextcloud/lib/private/legacy/template.php line 184
OC\TemplateLayout->__construct("user", "deck")
25. /var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php line 167
OC_Template->fetchPage([])
26. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 123
OCP\AppFramework\Http\TemplateResponse->render()
27. /var/www/nextcloud/lib/private/AppFramework/App.php line 125
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Deck\Controller\PageController {}, "index")
28. /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
OC\AppFramework\App::main("OCA\\Deck\\Controller\\PageController", "index", OC\AppFramework\ ... {}, {_route: "deck.page.index"})
29. <<closure>>
OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "deck.page.index"})
30. /var/www/nextcloud/lib/private/Route/Router.php line 299
call_user_func(OC\AppFramework\ ... {}, {_route: "deck.page.index"})
31. /var/www/nextcloud/lib/base.php line 1008
OC\Route\Router->match("/apps/deck/")
32. /var/www/nextcloud/index.php line 38
OC::handleRequest()
GET /apps/deck/
from {redacted} by {redacted} at 2020-05-14T03:36:55+00:00
Other errors while generating previews, this is completely spamming logs.
@acsfer - when repro’d, are you presented with a 500 error?
I'm able to reproduce this problem when attempting to run encryption:encrypt-all
on an instance with S3 backed storage. ~It's consistently failing at the same file.~ Update, doesn't appear to be the case as I just got a different file failure.
TypeError: Argument 1 passed to OC\Files\Cache\CacheQueryBuilder::whereFileId() must be of the type int, null given, called in /var/www/html/lib/private/Files/Cache/Cache.php on line 661 and defined in /var/www/html/lib/private/Files/Cache/CacheQueryBuilder.php:66
Stack trace:
#0 /var/www/html/lib/private/Files/Cache/Cache.php(661): OC\Files\Cache\CacheQueryBuilder->whereFileId(NULL)
#1 /var/www/html/lib/private/Files/Cache/Cache.php(585): OC\Files\Cache\Cache->moveFromCache(Object(OC\Files\Cache\Cache), 'files/Google/Ta...', 'files/Google/Ta...')
#2 /var/www/html/lib/private/Files/ObjectStore/ObjectStoreStorage.php(347): OC\Files\Cache\Cache->move('files/Google/Ta...', 'files/Google/Ta...')
#3 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(278): OC\Files\ObjectStore\ObjectStoreStorage->rename('files/Google/Ta...', 'files/Google/Ta...')
#4 /var/www/html/lib/private/Files/Storage/Wrapper/Availability.php(295): OC\Files\Storage\Wrapper\Wrapper->rename('files/Google/Ta...', 'files/Google/Ta...')
#5 /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php(280): OC\Files\Storage\Wrapper\Availability->rename('files/Google/Ta...', 'files/Google/Ta...')
#6 /var/www/html/lib/private/Files/View.php(816): OC\Files\Storage\Wrapper\Encryption->rename('files/Google/Ta...', 'files/Google/Ta...')
#7 /var/www/html/apps/encryption/lib/Crypto/EncryptAll.php(307): OC\Files\View->rename('/evan/files/Goo...', '/evan/files/Goo...')
#8 /var/www/html/apps/encryption/lib/Crypto/EncryptAll.php(279): OCA\Encryption\Crypto\EncryptAll->encryptFile('/evan/files/Goo...')
#9 /var/www/html/apps/encryption/lib/Crypto/EncryptAll.php(249): OCA\Encryption\Crypto\EncryptAll->encryptUsersFiles('evan', Object(Symfony\Component\Console\Helper\ProgressBar), 'evan (1)')
#10 /var/www/html/apps/encryption/lib/Crypto/EncryptAll.php(223): OCA\Encryption\Crypto\EncryptAll->encryptAllUserFilesWithMasterKey(Object(Symfony\Component\Console\Helper\ProgressBar))
#11 /var/www/html/apps/encryption/lib/Crypto/EncryptAll.php(173): OCA\Encryption\Crypto\EncryptAll->encryptAllUsersFiles()
#12 /var/www/html/apps/encryption/lib/Crypto/Encryption.php(511): OCA\Encryption\Crypto\EncryptAll->encryptAll(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/core/Command/Encryption/EncryptAll.php(135): OCA\Encryption\Crypto\Encryption->encryptAll(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Encryption\EncryptAll->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/3rdparty/symfony/console/Application.php(1012): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Encryption\EncryptAll), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/console.php(100): OC\Console\Application->run()
#20 /var/www/html/occ(11): require_once('/var/www/html/c...')
@acsfer - when repro’d, are you presented with a 500 error?
Not always, but in some cases, yes.
Same here - trying to remove folder from group folder with error:
{"reqId":"3g9lsTqI5CGvvIjsNwof","level":3,"time":"2020-09-15T15:45:35+00:00","remoteAddr":"10.72.23.57","user":"C25706B5-6F13-4480-B6AF-58758421425A","app":"remote","method":"DELETE","url":"/remote.php/dav/files/C25706B5-6F13-4480-B6AF-58758421425A/%C3%9A%C4%8Detn%C3%AD%20-%20t%C3%BDm/vp-pokus","message":{"Exception":"TypeError","Message":"Argument 1 passed to OC\\Files\\Cache\\CacheQueryBuilder::whereFileId() must be of the type int, null given, called in /www/nextcloud/lib/private/Files/Cache/Cache.php on line 655"
The folder vp-pokus
was successfully created over web interface and trying to be removed.
It seems that direcotry/file is removed, just this exception means web ui or sync errors. Small hot fix (don't now if this is proper solution) is as follows:
--- lib/private/Files/Cache/Cache.php.orig 2020-09-15 21:37:02.746915649 +0200
+++ lib/private/Files/Cache/Cache.php 2020-09-15 21:36:50.565788163 +0200
@@ -645,6 +645,7 @@
}
}
+ if ($sourceId) {
$query = $this->getQueryBuilder();
$query->update('filecache')
->set('storage', $query->createNamedParameter($targetStorageId))
@@ -654,6 +655,7 @@
->set('parent', $query->createNamedParameter($newParentId, IQueryBuilder::PARAM_INT))
->whereFileId($sourceId);
$query->execute();
+ }
$this->connection->commit();
} else {
@vpecinka mind to open a PR to review?
Well, I'm not sure this is a valid solution. It is a hotfix but the real question is why the $sourceId
is null in this case.
May you change the Cache.php locally and confirm that this condition if ($sourceId) {
works for you as well?
Ok thanks; do you have a test case? My previous test case is not valid anymore in 19.0.3; it now trows an "Lock" warning and not the "CacheQueryBuilder" error.
I am able to reproduce this error on 18.0.9 while using "group folders" app
my_test
) and add yourself (a group you are member of) to itmy_test\sub\test.txt
)sub
@vpecinka i was able to test it today using https://github.com/nextcloud/server/issues/19009#issuecomment-693532936 and confirm if ($sourceId) {
works here.
I cannot reproduce this https://github.com/nextcloud/server/issues/19009#issuecomment-693532936 on NC21.0.2 If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen. The latest version can be seen by checking https://nextcloud.com/install/#install-clients and https://nextcloud.com/install/#instructions-server respectively.
I am reproducing the problem, in Nextcloud 27 (27.0.1.2).
It is running with MariaDB 10.2 (10.2.31), PHP 8.0 (8.0.26), under CentOS 7 (7.9.2009).
I have further attempted the process after a sequence of operations, including files:cleanup
, files:repair-tree
, and files:scan
, but such preparations produce no improvement.
Once the error occurs, I must restore the entire deployment from backup, because even thought the file store is only partially decrypted, subsequent calls to the same command for decryption report that the store is no longer encrypted, and performs no action.
The message shown for subsequent attempts to decrypt is as follows:
Server side encryption not enabled. Nothing to do
Reproduce case here: https://github.com/nextcloud/server/issues/19009#issuecomment-621916168