加载定制模块时,ElasticSearch控制器中出现“无此索引”错误

时间:2019-03-28 13:20:03

标签: elasticsearch sugarcrm

我已经在SugarCRM 8.0.0登台实例上的单个程序包中创建了一堆自定义modules。为了迁移这些modules,我决定publish打包,以便可以将可安装的zip上传到另一个实例。不幸的是,当我尝试使用模块加载器将zip文件上传到接收实例时,安装挂起80%,sugarlog中出现错误

我正在运行ElasticSearch 5.4,它与我正在运行的Sugar实例兼容。这是日志中显示的错误:

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.

我已经尝试过多次修复和重建,并且还尝试再次发布该软件包以重新检查是否有我可能没有注意到的错误。我尝试使用另一个实例进行上传,以防万一当前实例可能已损坏,但观察到的情况相同。我不知道是什么原因引起的。

1 个答案:

答案 0 :(得分:0)

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

这表明Elasticsearch索引丢失(或损坏)。

如何解决:

  • 以管理员权限登录到Sugar
  • 转到 管理-> 搜索 (或某些版本的Sugar中的全局搜索
  • 点击“ 计划系统索引 ”按钮(并确认与性能相关的javascript警报,如果有的话),然后将弹出一个带有列表的窗口出现
  • 在弹出窗口中向下滚动,然后选择“ 在执行索引时删除现有数据。仅对选定模块中的数据进行索引。 ”。
    这一步很重要。如果忘记选择此复选框,则重新索引将失败(因为它尝试重新填充现有索引,而不是从头开始创建索引)。
  • 通过点击“ 索引 ”按钮进行确认。这将(重新)创建您需要的索引。
  • 现在您应该可以再次安装新模块了!

注释:

  • Elasticsearch索引的名称基于$sugar_config['unique_key']config.php的值。更改此值并重建缓存将导致Sugar寻找新的索引名称。您必须如上所述触发一个重新索引(除非您以某种方式在Elasticsearch中重命名该索引,以便可以再次找到它)。
  • 除非您的cron / Schedulers正在运行,否则新创建的索引可能会保持为空(尽管这对于模块安装来说应该足够了)。如果Elastic Search Scheduler正在运行,它将在接下来的几分钟/小时内用数据填充索引,您可以使用Sugar右上角的搜索。