nextcloud / nextcloud/fulltextsearch

fulltextsearch failing to index documents after 19.0.6 -> 20.0.3 update

Open
#597 3 comments 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

fulltextsearch is failing to index new documents on update from 19.0.6 to 20.0.3. Elasticsearch is running and reachable (and able to write to its storage), and "occ fulltextsearch:test" passes all tests with "ok". This is running in the official dockerhub "nextcloud-apache" image. Search on documents already indexed works fine.

Indexing any document gives:

Error: Call to a member function getContent() on string in /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php:719
Stack trace:
#0 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(658): OCA\Files_FullTextSearch\Service\FilesService->updateContentFromFile('*** sensitive p...', Object(OC\Files\Node\File))
nextcloud/server#1 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(573): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\File))
nextcloud/server#2 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(621): OCA\Files_FullTextSearch\Service\FilesService->generateDocumentFromIndex(Object(OCA\FullTextSearch\Model\Index))
nextcloud/server#3 /var/www/html/custom_apps/files_fulltextsearch/lib/Provider/FilesProvider.php(291): OCA\Files_FullTextSearch\Service\FilesService->updateDocument(Object(OCA\FullTextSearch\Model\Index))
nextcloud/server#4 /var/www/html/custom_apps/fulltextsearch/lib/Service/IndexService.php(407): OCA\Files_FullTextSearch\Provider\FilesProvider->updateDocument(Object(OCA\FullTextSearch\Model\Index))
nextcloud/server#5 /var/www/html/custom_apps/fulltextsearch/lib/Command/Live.php(308): OCA\FullTextSearch\Service\IndexService->updateDocument(Object(OCA\FullTextSearch_Elasticsearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\Index))
nextcloud/server#6 /var/www/html/custom_apps/fulltextsearch/lib/Command/Live.php(261): OCA\FullTextSearch\Command\Live->liveCycle()

I've tried this on three nextcloud instances and it's reproducible each time, for example by running "occ fulltextsearch:stop; occ fulltextsearch:index"

In this case on the builtin document "Nextcloud Manual.pdf":

Exception: Elasticsearch\Common\Exceptions\ServerErrorResponseException
│ Message: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [content] not present as part of path [attachment.content]

I also tried removing and reinstalling the fulltextsearch apps from nextcloud, with no change.

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 custom_apps/files_fulltextsearch/lib/Service/FilesService.php around lines 658, 719, and 573, then follow the indexing path from the reported stack trace. Reproduce with occ fulltextsearch:stop; occ fulltextsearch:index and inspect the getContent() and attachment.content errors. Done means new documents, including the reported PDF, index successfully and become searchable without exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, elasticsearch, php
Domain
backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.