Open pelzvieh opened 3 years ago
I think this is the same problem I'm experiencing in #170 .
This is happening here:
/**
* @param IIndexDocument $document
*
* @return IIndex
*/
public function indexDocument(IIndexDocument $document): IIndex {
$document->initHash();
$index = null;
try {
$result = $this->indexService->indexDocument($this->client, $document);
$index = $this->indexService->parseIndexResult($document->getIndex(), $result);
$this->updateNewIndexResult(
$document->getIndex(), json_encode($result), 'ok',
IRunner::RESULT_TYPE_SUCCESS
);
return $index;
} catch (Exception $e) {
$this->manageIndexErrorException($document, $e);
}
try {
$result = $this->indexDocumentError($document, $e);
$index = $this->indexService->parseIndexResult($document->getIndex(), $result);
$this->updateNewIndexResult(
$document->getIndex(), json_encode($result), 'ok',
IRunner::RESULT_TYPE_WARNING
);
return $index;
} catch (Exception $e) {
$this->updateNewIndexResult(
$document->getIndex(), '', 'fail',
IRunner::RESULT_TYPE_FAIL
);
$this->manageIndexErrorException($document, $e);
}
return $document->getIndex();
}
For whatever reason the first try is catching an exception that's returning null.
FYI, @pelzvieh if you check the comments I made in the linked issue I found a solution for this. You need to increase http.max_content_length in the Elasticsearch config file (usually /etc/elasticsearch/elasticsearch.yml). I'm still concerned that this error could trigger in my setup with a max size limit of 100mb configured in Nextcloud and the default 100mb http.max_content_length in Elasticsearch.
Running occ fulltextsearch:index aborts with the following exception:
Obviously, introducing a check to parseIndexErrorException if the array argument is null, cures the problem, but I have no idea if this is semantically correct.