SuiteCRM giving error when performing indexes in Elastic Search

Hi All,

I have connected my suitecrm with elastic search and below are the versions I’m using

SuiteCRM Version 7.12.5
Elastic Search Version 7.10.2

But the issue is when i’m trying to perform indexing on CLI it is showing error related to MYSQL. Below is the log I’m getting after running command. Please help how to fix it.

[root@suitecrm-rh-php crm-ic-elastic]# vendor/bin/robo elastic:index
[=][19:33:48] Starting indexing procedures
[@][19:33:48] Indexing is performed using JsonSerializerDocumentifier
[@][19:33:48] Reading lock file cache/ElasticSearchIndexer.lock
[@][19:33:48] Last logged indexing performed on 2022-07-20 19:30:17 (3 minutes ago)
[@][19:33:48] A differential indexing will be performed
[@][19:33:48] Indexing module Accounts…
[@][19:33:48] Finished Accounts. Processed 0 Records
[?][19:33:48] Time metadata not found for Calls, performing full index for this module
[@][19:33:48] Indexing module Calls…
[@][19:33:48] Finished Calls. Processed 0 Records
[?][19:33:48] Time metadata not found for Cases, performing full index for this module
[@][19:33:48] Indexing module Cases…
[@][19:33:49] Indexed 1
Database failure. Please refer to suitecrm.log for details.[!][19:33:49] Failed to index module Cases! Exception details follow
[!][19:33:49] Exception: Database failure. Please refer to suitecrm.log for details. in /var/www/html/crm-ic-elastic/include/utils.php:1934
~ ~ ~ ~ Stack trace:
~ ~ ~ ~ #0 /var/www/html/crm-ic-elastic/include/database/DBManager.php(353): sugar_die(‘Database failur…’)
~ ~ ~ ~ #1 /var/www/html/crm-ic-elastic/include/database/DBManager.php(328): DBManager->registerError(‘Error retrievin…’, ‘Error retrievin…’, true)
~ ~ ~ ~ #2 /var/www/html/crm-ic-elastic/include/database/MysqliManager.php(179): DBManager->checkError(‘Error retrievin…’, true)
~ ~ ~ ~ #3 /var/www/html/crm-ic-elastic/include/database/MysqlManager.php(285): MysqliManager->query(’ SELECT cases…’, true, ‘Error retrievin…’)
~ ~ ~ ~ #4 /var/www/html/crm-ic-elastic/data/SugarBean.php(4273): MysqlManager->limitQuery(’ SELECT cases…’, 999, 1000, true, ‘Error retrievin…’)
~ ~ ~ ~ #5 /var/www/html/crm-ic-elastic/data/SugarBean.php(3536): SugarBean->process_list_query(’ SELECT cases…’, 999, 1000, 1000, ‘’)
~ ~ ~ ~ #6 /var/www/html/crm-ic-elastic/lib/Search/ElasticSearch/ElasticSearchModuleDataPuller.php(167): SugarBean->get_list(‘id’, ‘’, 999, 1000, 1000, 0)
~ ~ ~ ~ #7 /var/www/html/crm-ic-elastic/lib/Search/ElasticSearch/ElasticSearchIndexer.php(212): SuiteCRM\Search\ElasticSearch\ElasticSearchModuleDataPuller->pullNextBatch()
~ ~ ~ ~ #8 /var/www/html/crm-ic-elastic/lib/Search/ElasticSearch/ElasticSearchIndexer.php(146): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer->indexModule(‘Cases’)
~ ~ ~ ~ #9 /var/www/html/crm-ic-elastic/lib/Search/ElasticSearch/ElasticSearchIndexer.php(586): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer->index()
~ ~ ~ ~ #10 /var/www/html/crm-ic-elastic/lib/Robo/Plugin/Commands/ElasticSearchCommands.php(120): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer::repairElasticsearchIndex(true, 0)
~ ~ ~ ~ #11 [internal function]: SuiteCRM\Robo\Plugin\Commands\ElasticSearchCommands->elasticIndex(1, 0, Array)
~ ~ ~ ~ #12 /var/www/html/crm-ic-elastic/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
~ ~ ~ ~ #13 /var/www/html/crm-ic-elastic/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
~ ~ ~ ~ #14 /var/www/html/crm-ic-elastic/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
~ ~ ~ ~ #15 /var/www/html/crm-ic-elastic/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
~ ~ ~ ~ #16 /var/www/html/crm-ic-elastic/vendor/symfony/console/Command/Command.php(298): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
~ ~ ~ ~ #17 /var/www/html/crm-ic-elastic/vendor/symfony/console/Application.php(1023): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
~ ~ ~ ~ #18 /var/www/html/crm-ic-elastic/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
~ ~ ~ ~ #19 /var/www/html/crm-ic-elastic/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
~ ~ ~ ~ #20 /var/www/html/crm-ic-elastic/vendor/consolidation/robo/src/Runner.php(282): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
~ ~ ~ ~ #21 /var/www/html/crm-ic-elastic/vendor/consolidation/robo/src/Runner.php(158): Robo\Runner->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput), Object(Robo\Application), Array, Object(Composer\Autoload\ClassLoader))
~ ~ ~ ~ #22 /var/www/html/crm-ic-elastic/vendor/consolidation/robo/robo(49): Robo\Runner->execute(Array)
~ ~ ~ ~ #23 {main}
[@][19:33:49] Indexing module Contacts…
[@][19:33:49] Finished Contacts. Processed 0 Records
[@][19:33:49] Indexing module Documents…
[@][19:33:49] Finished Documents. Processed 0 Records
[@][19:33:49] Indexing module Leads…
[@][19:33:49] Finished Leads. Processed 0 Records
[@][19:33:49] Indexing module Meetings…
[@][19:33:49] Finished Meetings. Processed 0 Records
[@][19:33:49] Indexing module Notes…
[@][19:33:49] Finished Notes. Processed 0 Records
[?][19:33:49] Time metadata not found for Opportunities, performing full index for this module
[@][19:33:49] Indexing module Opportunities…
[@][19:33:49] Finished Opportunities. Processed 0 Records
[@][19:33:49] Writing lock file to cache/ElasticSearchIndexer.lock
[@][19:33:49] 0 modules, 1 records and 45 fields indexed in 1.165 s
[=][19:33:49] Indexing complete