nextcloud / nextcloud/fulltextsearch

occ fulltextsearch:index throws exception: OCA\Files_FullTextSearch\Service\ExternalFilesService::getExternalMountById() must be of the type integer, null given

Open
#538 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,

I run Nextcloud 16.0.4 with Fulltextsearch 1.3.6. When executing occ fulltextsearch:index for the first time to build an index, I fail with index completion as an exception is thrown during building the index.

This is the last output from building the index:

Options: []
Memory: 541 MB
┌─ Indexing ────
│ Action: compareWithCurrentIndex
│ Provider: Files Account:
│ Document: 4792039
│ Info: //
│ Title:
│ Content size:
│ Chunk: 30/63
│ Progress: 56000/56947
└──
┌─ Results ────
│ Result: 8/8
│ Index: files:3426838
│ Status: ok
│ Message: {"_index":"nextcloud","_type":"standard","_id":"files:3426838","_version":1,"result":"noop"
│ ,"_shards":{"total":0,"successful":0,"failed":0}}

└──
┌─ Errors ────
│ Error: 8165/8165
│ Index: files:98555
│ Exception: Elasticsearch\Common\Exceptions\ServerErrorResponseException
│ Message: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [content] not
│ present as part of path [attachment.content]

└──

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

From this state, occ fulltextsearch:index stopped execution:

An unhandled exception has been thrown: TypeError: Argument 1 passed to OCA\Files_FullTextSearch\Service\ExternalFilesService::getExternalMountById() must be of the type integer, null given, called in /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php on line 244 and defined in /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php:258 Stack trace: #0 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(244): OCA\Files_FullTextSearch\Service\ExternalFilesService->getExternalMountById(NULL) #1 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(156): OCA\Files_FullTextSearch\Service\ExternalFilesService->getMountPoint(Object(OC\Files\Node\Folder)) #2 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(423): OCA\Files_FullTextSearch\Service\ExternalFilesService->getFileSource(Object(OC\Files\Node\Folder), '') #3 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(382): OCA\Files_FullTextSearch\Service\FilesService->getFileSource(Object(OC\Files\Node\Folder)) #4 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(359): OCA\Files_FullTextSearch\Service\FilesService->generateFilesDocumentFromFile('<user>', Object(OC\Files\Node\Folder)) #5 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(260): OCA\Files_FullTextSearch\Service\FilesService->generateFilesDocumentFromParent('<user>', Object(OC\Files\Node\Folder)) #6 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(254): OCA\Files_FullTextSearch\Service\FilesService->getFilesFromUser('<user>', '/<user>...') #7 /var/www/html/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(193): OCA\Files_FullTextSearch\Provider\FilesProvider->generateIndexableDocuments('<user>', '/<user>...') #8 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), '<user>', Object(OCA\FullTextSearch\Model\IndexOptions)) #9 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\IndexOptions)) #10 /var/www/html/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)) #11 /var/www/html/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #12 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #13 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #14 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #16 /var/www/html/nextcloud/console.php(97): OC\Console\Application->run() #17 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')

Thanks for your your support!

Best regards,
Peter

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 with apps/files_fulltextsearch/lib/Service/ExternalFilesService.php at lines 244 and 258, then trace the caller chain through FilesService.php. Reproduce with occ fulltextsearch:index using the reported Nextcloud and Fulltextsearch versions and inspect the external mount value for the failing folder. Done means indexing no longer terminates with the reported TypeError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.