Sharing a folder through federation shows size "Pending" and mtime "Unkown date". files:scan throws exception.
Open
@leftybournes is already working on this.
Since Jun 16, 2026.
34-feedback
bug
feature: federation
feature: files
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
Repro
- As Alice on Instance One, have default folder for acceptes shares set to
/Inboxin Personal Settings → Sharing (might be optional) - As Bob on Instance Two share a folder through federation to Alice at Instance One
- As Alice accept the share and reload Files
- As admin run
occ files:scan --verbose aliceon Instance One3. As Alice accept reload Files once more
Observed:
- The shared folder does not appear under
/Inboxas configure, but within the user home - The Size is set as "Pending" and stays so
- The Modified date is set as "Unknown date" and stays so
- The occ command lists the received folder, but instead of the actual contents those
filesanduploadsas content - The occ command crashes with a
TypeError
Details
occ output as file list
…
Folder /master/files/Five five five/
Folder /master/files/Five five five/files
Folder /master/files/Five five five/uploads
An unhandled exception has been thrown:
…
Exception stacktrace
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}
The problem with the code is that https://github.com/nextcloud/server/blob/fd14234a6a6998fad403bc5c62ac44d0e26b4d38/lib/private/Files/Cache/Cache.php#L1041 expects the fileid to be set, but in this case, the field does not exist, is not checked, and is later unconditionally passed to whereParent() which expects an int.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.