nextcloud / nextcloud/fulltextsearch

unhandled exception when user marked as deleted from LDAP

Open
#277 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3. to review bug
Dominant language
PHP
Stars
234
Forks
64
Avg merge
6h 18m
Merged PRs (30d)
10

Description

Indexing threw an unhandled exception and aborted:

USER: user116985
An unhandled exception has been thrown:
Error: Call to a member function instanceOfStorage() on null in /var/www/nextcloud/lib/private/Files/View.php:1922
Stack trace:
#0 /var/www/nextcloud/lib/private/Files/View.php(2036): OC\Files\View->lockPath('/user251442', 1, false)
#1 /var/www/nextcloud/lib/private/Files/View.php(1134): OC\Files\View->lockFile('/user251442', 1)
#2 /var/www/nextcloud/lib/private/Files/View.php(267): OC\Files\View->basicOperation('mkdir', '/user251442', Array)
#3 /var/www/nextcloud/lib/private/Files/Node/Folder.php(160): OC\Files\View->mkdir('/user251442')
#4 /var/www/nextcloud/lib/private/Files/Node/Root.php(380): OC\Files\Node\Folder->newFolder('/user251442')
#5 [internal function]: OC\Files\Node\Root->getUserFolder('user251442')
#6 /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php(64): call_user_func_array(Array, Array)
#7 /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php(281): OC\Files\Node\LazyRoot->__call('getUserFolder', Array)
#8 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(264): OC\Files\Node\LazyRoot->getUserFolder('user251442')
#9 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(735): OCA\Files_FullTextSearch\Service\FilesService->getPathFromViewerId(512001, 'user251442')
#10 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(537): OCA\Files_FullTextSearch\Service\FilesService->getShareNamesFromFile(Object(OC\Files\Node\Folder), Object(OCA\FullTextSearch\Model\DocumentAccess))
#11 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(485): OCA\Files_FullTextSearch\Service\FilesService->updateAccessFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#12 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(466): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#13 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(400): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentFromFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#14 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(203): OCA\Files_FullTextSearch\Service\FilesService->generateDocuments(Array)
#15 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(248): OCA\Files_FullTextSearch\Provider\FilesProvider->fillIndexDocuments(Array)
#16 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(218): OCA\FullTextSearch\Service\IndexService->indexChunk(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array)
#17 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(127): OCA\FullTextSearch\Service\IndexService->indexChunks(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array)
#18 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(146): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), 'user116985')
#19 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(119): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider))
#20 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(264): OCA\FullTextSearch\Command\Index->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/nextcloud/core/Command/Base.php(161): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/nextcloud/3rdparty/symfony/console/Application.php(874): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/nextcloud/3rdparty/symfony/console/Application.php(228): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/nextcloud/3rdparty/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /var/www/nextcloud/lib/private/Console/Application.php(173): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/nextcloud/console.php(90): OC\Console\Application->run()
#27 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#28 {main}

user251442 had been deleted from LDAP and hence marked as deleted in Nextcloud (but not deleted with occ user:delete yet)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/files_fulltextsearch/lib/Service/FilesService.php at lines 264 and 735, then trace the getUserFolder call in the stack trace while indexing a user marked deleted by LDAP. Reproduce indexing for that state and determine the expected handling. Done means the index command no longer aborts with the null instanceOfStorage() exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.