TypeError: OC\Files\Cache\CacheQueryBuilder::whereParent(): Argument #1 ($parent) must be of type int, null given, called in /srv/http/nextcloud/master/lib/private/Files/Cache/Cache.php on line 1050 and defined in /srv/http/nextcloud/master/lib/private/Files/Cache/CacheQueryBuilder.php:89
Stack trace:
#0 /srv/http/nextcloud/master/lib/private/Files/Cache/Cache.php(1050): OC\Files\Cache\CacheQueryBuilder->whereParent(NULL)
#1 /srv/http/nextcloud/master/lib/private/Files/Cache/Cache.php(1023): OC\Files\Cache\Cache->calculateFolderSizeInner('', Object(OC\Files\Cache\CacheEntry))
#2 /srv/http/nextcloud/master/lib/private/Files/Cache/Cache.php(969): OC\Files\Cache\Cache->calculateFolderSize('', NULL)
#3 /srv/http/nextcloud/master/lib/private/Files/Utils/Scanner.php(237): OC\Files\Cache\Cache->correctFolderSize('')
#4 /srv/http/nextcloud/master/apps/files/lib/Command/Scan.php(169): OC\Files\Utils\Scanner->scan('...', true, Object(Closure))
#5 /srv/http/nextcloud/master/apps/files/lib/Command/Scan.php(260): OCA\Files\Command\Scan->scanFiles('...', '...', NULL, Object(Symfony\Component\Console\Output\ConsoleOutput), Object(Closure), false, true)
#6 /srv/http/nextcloud/master/apps-repos/workflow_pdf_converter/vendor/symfony/console/Command/Command.php(341): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /srv/http/nextcloud/master/core/Command/Base.php(222): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /srv/http/nextcloud/master/apps-repos/workflow_pdf_converter/vendor/symfony/console/Application.php(1079): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /srv/http/nextcloud/master/apps-repos/workflow_pdf_converter/vendor/symfony/console/Application.php(356): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /srv/http/nextcloud/master/apps-repos/workflow_pdf_converter/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /srv/http/nextcloud/master/lib/private/Console/Application.php(188): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /srv/http/nextcloud/master/console.php(92): OC\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#13 /srv/http/nextcloud/master/occ(33): require_once('...')
#14 {main}
Repro
/Inboxin Personal Settings → Sharing (might be optional)occ files:scan --verbose aliceon Instance One3. As Alice accept reload Files once moreObserved:
/Inboxas configure, but within the user homefilesanduploadsas contentTypeErrorDetails
occ output as file list
Exception stacktrace
The problem with the code is that
server/lib/private/Files/Cache/Cache.php
Line 1041 in fd14234
fileidto be set, but in this case, the field does not exist, is not checked, and is later unconditionally passed towhereParent()which expects an int.