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

Updated to Nextcloud 16 An unhandled exception has been thrown: #492

Closed
Omaha2002 opened this issue May 2, 2019 · 16 comments · Fixed by nextcloud/deck#1049
Closed

Updated to Nextcloud 16 An unhandled exception has been thrown: #492

Omaha2002 opened this issue May 2, 2019 · 16 comments · Fixed by nextcloud/deck#1049

Comments

@Omaha2002
Copy link

After updating Nextcloud 15.0.7 to 16.0 I found out that results from one groupfolder didn't show up anymore so I decided to reset and reindex database.

sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:reset > OK
sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:test > OK

.Testing your current setup:
Creating mocked content provider. ok
Testing mocked provider: get indexable documents. (2 items) ok
Loading search platform. (Elasticsearch) ok
Testing search platform. ok
Locking process ok
Removing test. ok
Pausing 3 seconds 1 2 3 ok
Initializing index mapping. ok
Indexing generated documents. ok
Pausing 3 seconds 1 2 3 ok
Retreiving content from a big index (license). (size: 32386) ok
Comparing document with source. ok
Searching basic keywords:

  • 'test' (result: 1, expected: ["simple"]) ok
  • 'document is a simple test' (result: 2, expected: ["simple","license"]) ok
  • '"document is a test"' (result: 0, expected: []) ok
  • '"document is a simple test"' (result: 1, expected: ["simple"]) ok
  • 'document is a simple -test' (result: 1, expected: ["license"]) ok
  • 'document is a simple +test' (result: 1, expected: ["simple"]) ok
  • '-document is a simple test' (result: 0, expected: []) ok
    Updating documents access. ok
    Pausing 3 seconds 1 2 3 ok
    Searching with group access rights:
  • 'license' - [] - (result: 0, expected: []) ok
  • 'license' - ["group_1"] - (result: 1, expected: ["license"]) ok
  • 'license' - ["group_1","group_2"] - (result: 1, expected: ["license"]) ok
  • 'license' - ["group_3","group_2"] - (result: 1, expected: ["license"]) ok
  • 'license' - ["group_3"] - (result: 0, expected: []) ok
    Searching with share rights:
  • 'license' - notuser - (result: 0, expected: []) ok
  • 'license' - user2 - (result: 1, expected: ["license"]) ok
  • 'license' - user3 - (result: 1, expected: ["license"]) ok
    Removing test. ok
    Unlocking process ok

sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:index > ERROR

An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\FullTextSearch\Model\IndexDocument::setContent() must be of the type string, null given, called in /var/www/nextcloud/apps/deck/lib/Service/FullTextSearchService.php on line
Stack trace:
#0 /var/www/nextcloud/apps/deck/lib/Service/FullTextSearchService.php(182): OC\FullTextSearch\Model\IndexDocument->setContent(NULL)
#1 /var/www/nextcloud/apps/deck/lib/Provider/DeckProvider.php(187): OCA\Deck\Service\FullTextSearchService->fillIndexDocument(Object(OC\FullTextSearch\Model\IndexDocument))
#2 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(325): OCA\Deck\Provider\DeckProvider->fillIndexDocument(Object(OC\FullTextSearch\Model\IndexDocument))
#3 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(205): OCA\FullTextSearch\Service\IndexService->indexDocuments(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Obj
#4 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatforns))
#5 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Deck\Provider\DeckProvider), Object(OCA\FullTextSearch\Model\IndexOptions))
#6 /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\Con
#7 /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))
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInp
#10 /var/www/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\Con
#11 /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\ConsoleOut
#12 /var/www/nextcloud/console.php(97): OC\Console\Application->run()
#13 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

Elasticsearch 6.7.1
PHP 7.3-FPM
NGINX
Full text search 1.3.1
Full text search - Elasticsearch Platform 1.3.0
Full text search - Files 1.3.0

@syntron
Copy link

syntron commented May 5, 2019

I just tried to install elasticsearch on NC16 and got bitten by the same error ... latest versions of all NC apps + Elasticsearch 6.7.1

@Omaha2002
Copy link
Author

It is the deck app that causes this. Disabling it will make indexing work.

@syntron
Copy link

syntron commented May 7, 2019

@Omaha2002 Thanks for the hint! I can confirm that it is working if Deck is disabled.

@Omaha2002
Copy link
Author

Well, for me it still crashed at the end of indexing:

x:first result ## c/v:prec/next result ## b:last result

f:first error ## h/j:prec/next error ## d:delete error ## l:last error

q:quit ## p:pause

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(163): OC\Share20\Manager->getAccessLis t(Object(OC\Files\Node\File), true, true)
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(723): OCA\Files_FullTextSearch\Service\Loca lFilesService->getShareUsersFromFile(Object(OC\Files\Node\File), Array)
#2 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(652): OCA\Files_FullTextSearch\Service\File sService->updateShareNames(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\File))
#3 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(626): OCA\Files_FullTextSearch\Service\File sService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\File))
#4 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(607): OCA\Files_FullTextSearch\Service\File sService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\File))
#5 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(501): OCA\Files_FullTextSearch\Service\File sService->updateFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#6 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(263): OCA\Files_FullTextSearch\Service\Fi lesService->generateDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#7 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(325): OCA\Files_FullTextSearch\Provider\FilesProv ider->fillIndexDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#8 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(205): OCA\FullTextSearch\Service\IndexService->in dexDocuments(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Pr ovider\FilesProvider), Array, Object(OCA\FullTextSearch\Model\IndexOptions))
#9 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProv iderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSe arch\Provider\FilesProvider), 'r.ruiter@market...', Object(OCA\FullTextSearch\Model\IndexOptions))
#10 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider(O bject(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(Obje ct(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\Compone nt\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(901): 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(262): Symfony\Component\Console\A d(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Ob Console\Output\ConsoleOutput))
#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\A t(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutp
#16 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Applic ny\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/nextcloud/console.php(97): OC\Console\Application->run()
#18 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

@syntron
Copy link

syntron commented May 7, 2019

@Omaha2002 I will need some time till I come to this point; at least I could start it here ...

@truelai
Copy link

truelai commented May 14, 2019

Same issue here. Disabling Deck fixes the issue. The problem is I need both Deck and FTS.

Didn't this Deck/FTS conflict happen a month ago as well?

@ArtificialOwl
Copy link
Member

Anyone willing to test this fix on Deck ? : nextcloud/deck#1049

@truelai
Copy link

truelai commented May 16, 2019

Anyone willing to test this fix on Deck ? : nextcloud/deck#1049

I'll give it a shot.

@truelai
Copy link

truelai commented May 16, 2019

The patch seems to work.

Documented in #498

@Omaha2002
Copy link
Author

for me it doesn't, Deck 0.6.2:

sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:test -> OK
sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:reset -> OK
sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:index -> ERROR

An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\FullTextSearch\Model\IndexDocument::setContent() must be of the type string, null given, called in /var/www/nextcloud/apps/deck/lib/Service/FullTextSearchService.php on line 182 and defined in /var/www/nextcloud/lib/private/F ullTextSearch/Model/IndexDocument.php:477
Stack trace:
#0 /var/www/nextcloud/apps/deck/lib/Service/FullTextSearchService.php(182): OC\FullTextSearch\Model\IndexDocument->setContent(NULL )
#1 /var/www/nextcloud/apps/deck/lib/Provider/DeckProvider.php(187): OCA\Deck\Service\FullTextSearchService->fillIndexDocument(Obje ct(OC\FullTextSearch\Model\IndexDocument))
#2 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(325): OCA\Deck\Provider\DeckProvider->fillIndexDocument(Obj ect(OC\FullTextSearch\Model\IndexDocument))
#3 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(205): OCA\FullTextSearch\Service\IndexService->indexDocumen ts(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Deck\Provider\DeckProvider), Array, Object( OCA\FullTextSearch\Model\IndexOptions))
#4 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProviderConten tFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Deck\Provider\DeckProvider), 'anton. klein@bnc...', Object(OCA\FullTextSearch\Model\IndexOptions))
#5 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\D eck\Provider\DeckProvider), Object(OCA\FullTextSearch\Model\IndexOptions))
#6 /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))
#7 /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))
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\In put\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OC A\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\Consol eOutput))
#10 /var/www/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\ Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Compone nt\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/nextcloud/console.php(97): OC\Console\Application->run()
#13 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

@ArtificialOwl
Copy link
Member

@Omaha2002 did you apply the patch ?

@truelai
Copy link

truelai commented May 17, 2019

@Omaha2002 I used the Deck patch provided by @daita. Can you post the contents of your file here?

/var/www/nextcloud/apps/deck/lib/Service/FullTextSearchService.php

@Omaha2002
Copy link
Author

I'm sorry guys, I didn't use the patch, I thought the updated deck would fix the problems. I'll try later this weekend.

@syntron
Copy link

syntron commented May 17, 2019

I can confirm that the patch is working; I changed the two lines manually and now Deck is activated and fulltextsearch index is running

@Omaha2002
Copy link
Author

Omaha2002 commented May 18, 2019

I can confirm that the patch works too regarding Deck. Changed lines manually too and with Deck activated fulltextsearch index is running but exits with an error. I think it's another app that causes it:

┌─ Errors ────
│ Error: 18/18
│ Index: files:22812
│ Exception: Elasticsearch\Common\Exceptions\ServerErrorResponseException
│ Message: java.lang.IllegalArgumentException: ElasticsearchParseException[Error parsing document in field [conten
│ t]]; nested: TikaException[Error creating OOXML extractor]; nested: XmlValueOutOfRangeException [Invalid integer v
│ alue: ];
└──

x:first result ## c/v:prec/next result ## b:last result

f:first error ## h/j:prec/next error ## d:delete error ## l:last error

q:quit ## p:pause

An unhandled exception has been thrown:
Error: Call to a member function getUID() on null in /var/www/nextcloud/lib/private/Share20/Manag er.php:1433
Stack trace:
#0 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/LocalFilesService.php(163): OC\Share2 0\Manager->getAccessList(Object(OC\Files\Node\File), true, true)
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(723): OCA\Files_Full TextSearch\Service\LocalFilesService->getShareUsersFromFile(Object(OC\Files\Node\File), Array)
#2 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(652): OCA\Files_Full TextSearch\Service\FilesService->updateShareNames(Object(OCA\Files_FullTextSearch\Model\FilesDocu ment), Object(OC\Files\Node\File))
#3 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(626): OCA\Files_Full TextSearch\Service\FilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\Files Document), Object(OC\Files\Node\File))
#4 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(607): OCA\Files_Full TextSearch\Service\FilesService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Mode l\FilesDocument), Object(OC\Files\Node\File))
#5 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(501): OCA\Files_Full TextSearch\Service\FilesService->updateFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesD ocument))
#6 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(263): OCA\Files_Fu llTextSearch\Service\FilesService->generateDocument(Object(OCA\Files_FullTextSearch\Model\FilesDo cument))
#7 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(325): OCA\Files_FullTextSe arch\Provider\FilesProvider->fillIndexDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocumen t))
#8 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(205): OCA\FullTextSearch\S ervice\IndexService->indexDocuments(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearc hPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array, Object(OCA\FullTextSe arch\Model\IndexOptions))
#9 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\ IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\Elast icSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), 'r.ruiter@market...', Object(OCA\FullTextSearch\Model\IndexOptions))
#10 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command \Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTex tSearch\Model\IndexOptions))
#11 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Comm and\Index->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Co nsole\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\Conso leOutput))
#13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(O bject(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\Console Output))
#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\A pplication->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Conso le\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\A pplication->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Con sole\Output\ConsoleOutput))
#16 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Applic ation->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Ou tput\ConsoleOutput))
#17 /var/www/nextcloud/console.php(97): OC\Console\Application->run()
#18 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

@drpetersen
Copy link

drpetersen commented May 19, 2019

I get this error (Call to a member function getUID() on null in /var/www/nextcloud/lib/private/Share20/Manag er.php:1433) as soon as indexing hits the first document shared to the user whose files are being indexed. When I revoke that share and restart indexing (occ fulltextsearch:stop; occ fulltextsearch:index), indexing can go further, that is, until the next (incoming) shared document is reached. Maybe this helps finding the source of the error?
Edit: By the way, this is with the deck app disabled.

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

Successfully merging a pull request may close this issue.

5 participants