elasticsearchsugarcrm

"No such index" error in ElasticSearch controller when loading custom module


I had created a bunch of custom modules bundled in a single package on a SugarCRM 8.0.0 staging instance. In order to migrate these modules I decided to publish the package so that I could have an installable zip uploaded to another instance. Unfortunately when I try to upload the zip file on the receiving instance using module loader, the installation hangs at 80 percent gives an error in the sugarlog

I am running ElasticSearch 5.4 which is compatible with the instance of the Sugar I am running. This is the error that is shown in the logs:

Thu Mar 28 17:54:19 2019 [1786][1][FATAL] Elasticsearch request failure: no such index [index: ab164c0013004724c8eba5f5f6f3f646_shared]
Thu Mar 28 17:54:19 2019 [1786][1][FATAL] Exception in Controller: Elastica\Exception\ResponseException: no such index [index: ab164c0013004724c8eba5f5f6f3f646_shared] in /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:179
Stack trace:
#0 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Request.php(193): Elastica\Transport\Http->exec(Object(Elastica\Request), Array)
#1 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Client.php(674): Elastica\Request->send()
#2 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Adapter/Client.php(355): Elastica\Client->request('ab164c001300472...', 'PUT', Array, Array)
#3 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Client.php(706): Sugarcrm\Sugarcrm\Elasticsearch\Adapter\Client->request('ab164c001300472...', 'PUT', Array, Array)
#4 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Index.php(562): Elastica\Client->requestEndpoint(Object(Elasticsearch\Endpoints\Indices\Mapping\Put))
#5 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Type.php(523): Elastica\Index->requestEndpoint(Object(Elasticsearch\Endpoints\Indices\Mapping\Put))
#6 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Type/Mapping.php(250): Elastica\Type->requestEndpoint(Object(Elasticsearch\Endpoints\Indices\Mapping\Put))
#7 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(486): Elastica\Type\Mapping->send()
#8 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(390): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager->sendMapping(Object(Elastica\Type\Mapping))
#9 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(285): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager->createIndices(Object(Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexCollection), Object(Sugarcrm\Sugarcrm\Elasticsearch\Analysis\AnalysisBuilder), Object(Sugarcrm\Sugarcrm\Elasticsearch\Mapping\MappingCollection), false)
#10 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(200): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager->syncIndices(Array, false)
#11 /var/www/html/SugarPro-Full-8/src/SearchEngine/Engine/Elastic.php(113): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager->addMappings(Array)
#12 /var/www/html/SugarPro-Full-8/ModuleInstall/ModuleInstaller.php(3489): Sugarcrm\Sugarcrm\SearchEngine\Engine\Elastic->addMappings(Array)
#13 /var/www/html/SugarPro-Full-8/ModuleInstall/ModuleInstaller.php(168): ModuleInstaller->setup_elastic_mapping()
#14 /var/www/html/SugarPro-Full-8/modules/Administration/UpgradeWizard_commit.php(342): ModuleInstaller->install('cache/upgrades/...')
#15 /var/www/html/SugarPro-Full-8/include/MVC/View/SugarView.php(489): require_once('/var/www/html/S...')
#16 /var/www/html/SugarPro-Full-8/include/MVC/View/views/view.classic.php(43): SugarView->includeClassicFile('cache/upgrades/...')
#17 /var/www/html/SugarPro-Full-8/include/MVC/View/SugarView.php(152): ViewClassic->display(Array)
#18 /var/www/html/SugarPro-Full-8/include/MVC/Controller/SugarController.php(351): SugarView->process(Array)
#19 /var/www/html/SugarPro-Full-8/include/MVC/Controller/SugarController.php(299): SugarController->processView()
#20 /var/www/html/SugarPro-Full-8/include/MVC/SugarApplication.php(198): SugarController->execute()
#21 /var/www/html/SugarPro-Full-8/index.php(27): SugarApplication->execute()
#22 {main}
Thu Mar 28 17:54:19 2019 [1786][1][FATAL] ERROR: rmdir_recursive(): argument cache/upgrades/temp/ICB8l3 is not a file or a dir.

I have tried to repair and rebuild several times, and have also tried to publish the package again to recheck if there were any errors I may have not noticed. I tried to use another instance for uploading in case my current instance may be corrupt, but the same was observed. I do not understand what may be causing the issue.


Solution

  • Elasticsearch request failure: no such index [index: ...]
    

    This suggests that the Elasticsearch Index is missing (or corrupted).

    How to fix:

    Notes: