Skip to content
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

Fix full text search for groupfolders #15832

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

MorrisJobke
Copy link
Member

@MorrisJobke MorrisJobke commented May 31, 2019

How to reproduce:

  • have a group folder
  • enable full text search
  • actual: the initial scan works until the group folder is scanned
  • expected: initial scan of the full text search works

Fixes following error:

An unhandled exception has been thrown:
Error: Call to a member function getUID() on null in /var/www/nextcloud/lib/private/Share20/Manager.php:1433
Stack trace:
#0 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/LocalFilesService.php(162): OC\Share20\Manager->getAccessList(Object(OC\Files\Node\Folder), true, true)
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(667): OCA\Files_FullTextSearch\Service\LocalFilesService->getShareUsersFromFile(Object(OC\Files\Node\Folder), Array)
#2 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(596): OCA\Files_FullTextSearch\Service\FilesService->updateShareNames(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#3 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(570): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#4 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(551): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#5 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(445): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#6 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(246): OCA\Files_FullTextSearch\Service\FilesService->generateDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#7 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(314): OCA\Files_FullTextSearch\Provider\FilesProvider->fillIndexDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#8 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(194): OCA\FullTextSearch\Service\IndexService->indexDocuments(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array, Object(OCA\FullTextSearch\Model\IndexOptions))
#9 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(408): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), 'ABC', Object(OCA\FullTextSearch\Model\IndexOptions))
#10 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(272): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\IndexOptions))
#11 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/nextcloud/console.php(96): OC\Console\Application->run()
#18 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#19 {main}

cc @daita @icewind1991

Fix #15074

@MorrisJobke MorrisJobke added bug 3. to review Waiting for reviews labels May 31, 2019
@MorrisJobke MorrisJobke added this to the Nextcloud 17 milestone May 31, 2019
@ArtificialOwl
Copy link
Member

Cannot reproduce myself the issue, but code is good enough (for me)

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
@ArtificialOwl ArtificialOwl force-pushed the bugfix/noid/fulltext-search-groupfolders branch from 4861354 to 9dac971 Compare June 17, 2019 13:53
@ArtificialOwl
Copy link
Member

/backport to stable16

@ArtificialOwl
Copy link
Member

/backport to stable15

@rullzer rullzer merged commit 2f5810f into master Jun 25, 2019
@rullzer rullzer deleted the bugfix/noid/fulltext-search-groupfolders branch June 25, 2019 19:43
@backportbot-nextcloud
Copy link

backport to stable16 in #16082

@backportbot-nextcloud
Copy link

backport to stable15 in #16083

@Omaha2002
Copy link

This bug seems to have returned in NC21:

An unhandled exception has been thrown:
Error: Call to a member function getOwner() on null in /var/www/nextcloud/lib/private/Share20/Manager.php:1651
Stack trace:
#0 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/LocalFilesService.php(163): OC\Share20\Manager->getAccessList()
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(795): OCA\Files_FullTextSearch\Service\LocalFilesService->getShareUsersFromFile()
#2 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(725): OCA\Files_FullTextSearch\Service\FilesService->updateShareNames()
#3 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(699): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentAccess()
#4 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(680): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocumentFromFile()
#5 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(571): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocument()
#6 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(288): OCA\Files_FullTextSearch\Service\FilesService->generateDocument()
#7 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(317): OCA\Files_FullTextSearch\Provider\FilesProvider->fillIndexDocument()
#8 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(204): OCA\FullTextSearch\Service\IndexService->indexDocuments()
#9 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(410): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()
#10 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider()
#11 /var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute()
#12 /var/www/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#13 /var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#14 /var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#15 /var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#16 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#17 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#18 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

versions:
image

Server version: 21.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fulltextsearch:index fails: Call to a member function getUID() on null
5 participants