nextcloud / nextcloud/fulltextsearch

An unhandled exception has been thrown:

Open
#591 2 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

Hi,

I use nextcloud 19.0.4
Php 7.4
nginx
Debian 10 (OMV 5)
Elasticsearch 7.10.0 (via Docker, same problem happened with 6.x. and 7.x without docker).
Nextcloud Apps (only tell the one I think could be usefull to know to find the issue):
Full text search 1.4.2
Full text search - Elasticsearch Platform 1.5.2
Full text search - Files 1.4.3
Group Folder 7.1.1
External Storage Support 1.10.0

I have multiple Shared Folders and two big SMB folders (hosted on same server).

I think the Search Feature is a great step in the right direction for the nextcloud platform and I would like use it, but it just crashes again and again. I am glad for any help :)

The crash happened after an .ods file in a group folder (this time, don't know the other ones).

Memory: 129 MB
┌─ Indexing  ────
│ Action: indexDocument
│ Provider: Files                Account: someusername
│ Document: 605513
│ Info: application/vnd.oasis.opendocument.spreadsheet
│ Title: Group Share/IMPORTANT_DOCUMENT/Excel-Files/ListeBücher.ods
│ Content size: 4311292
│ Chunk:    139/166
│ Progress:    217/2438
└──
┌─ Results ────
│ Result:  84688/84688
│ Index: files:605507
│ Status: ok
│ Message: {"_index":"nextcloud_index","_type":"standard","_id":"files:605507","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed"
│ :0},"_seq_no":84050,"_primary_term":1}
│
└──
┌─ Errors ────
│ Error:    629/629
│ Index: files:605508
│ Exception: Elasticsearch\Common\Exceptions\BadRequest400Exception
│ Message: 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
An unhandled exception has been thrown:
TypeError: Return value of OCA\FullTextSearch_ElasticSearch\Service\IndexMappingService::indexDocumentNew() must be of the type array, string returned in /var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/IndexMappingService.php:89
Stack trace:
#0 /var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/IndexService.php(197): OCA\FullTextSearch_ElasticSearch\Service\IndexMappingService->indexDocumentNew()
#1 /var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Platform/ElasticSearchPlatform.php(222): OCA\FullTextSearch_ElasticSearch\Service\IndexService->indexDocument()
#2 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(375): OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform->indexDocument()
#3 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(326): OCA\FullTextSearch\Service\IndexService->indexDocument()
#4 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(204): OCA\FullTextSearch\Service\IndexService->indexDocuments()
#5 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()
#6 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider()
#7 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute()
#8 /var/www/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1012): OC\Core\Command\Base->run()
#10 /var/www/nextcloud/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand()
#11 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun()
#12 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#13 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#14 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

The docker container (and before the non docker container) crashed/stopped. I had to start them again.
Then I entered:

sudo -u www-data php7.4 /var/www/nextcloud/occ fulltextsearch:stop
sudo -u www-data php7.4 /var/www/nextcloud/occ fulltextsearch:index

And I just saw the indexing got to this specific file but continued so it shoulnd't be a problem that this file is corrupt.

My config in Nextcloud is:

image
image

Don't know what to do, uninstalled all full text search apps and reinstalled them, put the whole thing in Docker.

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/fulltextsearch_elasticsearch/lib/Service/IndexMappingService.php at line 89, then trace the calls from IndexService.php and Platform/ElasticSearchPlatform.php. Reproduce the failure with the fulltextsearch:index command and the reported Elasticsearch mapping error. Done means indexing handles the affected document without the unhandled exception and the relevant behavior is covered by a test.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.