HTTP: 503 Service Unavailable  Search engine is temporarily unavailable- Global Search

Hi All

                I have recentely upgraded to sugarcrm 7.7.I am getting HTTP: 503 Service Unavailable  Search engine is temporarily unavailable - Global Search

in my global search.Can you please give inputs in debugging this error.

Regards

Sidhu

  • Hi Thiraviarajan Raman,

    Looks like your settings in configuration files changed. First, check if config.php or config_override.php and make sure that they have the following settings.

    array (
        'Elastic' =>
        array (
          'host' => 'localhost',
          'port' => '9200',
        ),

    Regards,

    Junaid

  • Hi All/@Lori F

    I am getting the same error for my local host. Initially it was working. I clicked on Schedule System Index from my Admin page, afterwords i am getting below error

    HTTP: 500 Internal Server Error

    No search engine configured

    I have verified that my elastic engine status from browser localhost:9200. I can able to get the response. But i am not able to login to Sugar itself throwing above error.

    Below is the logs i got from SugarCRM.log file.

    Thu Feb 21 07:42:13 2019 [19380][1][FATAL] Exception in Controller: RuntimeException: No search engine configured in C:\xampp\htdocs\SugarCRMLocal\src\SearchEngine\SearchEngine.php:57
    Stack trace:
    #0 C:\xampp\htdocs\SugarCRMLocal\modules\ModuleBuilder\views\view.modulefield.php(308): Sugarcrm\Sugarcrm\SearchEngine\SearchEngine::getInstance()
    #1 C:\xampp\htdocs\SugarCRMLocal\modules\ModuleBuilder\views\view.modulefield.php(39): ViewModulefield->fetch()
    #2 C:\xampp\htdocs\SugarCRMLocal\include\MVC\View\SugarView.php(152): ViewModulefield->display(Array)
    #3 C:\xampp\htdocs\SugarCRMLocal\include\MVC\Controller\SugarController.php(351): SugarView->process(Array)
    #4 C:\xampp\htdocs\SugarCRMLocal\include\MVC\Controller\SugarController.php(299): SugarController->processView()
    #5 C:\xampp\htdocs\SugarCRMLocal\include\MVC\SugarApplication.php(198): SugarController->execute()
    #6 C:\xampp\htdocs\SugarCRMLocal\index.php(27): SugarApplication->execute()
    #7 {main}

    I am using elasticsearch 5.6.0 version and Sugar 8.0.2 version. Can anyone please advise me how to resolve this?

    When i do inspect from browser, i got below error

    VM88:5 POST localhost/.../token 500 (Internal Server Error)

    Not able to locate this path in my local machine.

  • I just wonder, if upgrade fixed this issue, because I got same error with SugarCRM instance running 7.7.1.0, and plan to do upgrade anyway.

    However we didn't enable/disable any modules from global search.

  • Hi Fahad

                 I am using 7.7.1.0 as of now.

    Regards

    Sidhu

  • Hello, In 7.7.1.1 there is an issue with global search - https://web.sugarcrm.com/support/issues/8697d016-2a0f-0767-622b-57ce81ed4e45 

    I think you need to upgrade this to 7.7.1.2.

    Thanks

  • Hi Lori F

    I have checked the localhost:9200 working fine returned 200

    So these are the steps i need to follow

    1.I need to set  up a cron for every 5 minutes
    2.Then i have to do a system indexing(HOW TO I KNOW IF INDEXING HAS BEEN COMPLETED)

    Thats it

    Previously i was following below

    1.I have set up a cron for every 5 minutes
    2.Then i have done a system indexing
    3.Then i have made sugar that the elastic search scheduler runs at least once.

    4.After it has ran once i have disabled it.

    5.The cron continues to run for every five minutes

    The problem now is


       The record i was searching was for accounts and it is enabled.

    When i search for an account say 'test' i get the no records found in the global search

    But when i click on the search_icon i get this 500 error

    There are two things i am confused here
    1.when i just enter the names of my record for accounts i get no records found

    2.i get 500 erro when i click on the search_icon

    when i checked the sugarcrm log i get like the below(i.e. after i click on the search_icon)

    A search engine runtime error occurred:
    SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures

    Can you please provide insights to this and correct my steps to follow for elastic search which i have mentioned above.

    Regards

    Sidhu

  • Sidhu,

    You should not need to set up a scheduler for elasticsearch as it will run automatically from the back end.  I have seen in the past a 500 error occur when searching for a record when a module was removed but was still showing as enabled in Admin > Search.  Could this be what you are running into?

    Lori

  • Hi Lori F

             Can you please find the steps

    1.Setting up the elastic search in the server:

    2.I have set up the cron to run(Does elastic scheduler be active before doing step number 3?)

    3.Testing the search

    ->It has asked to perfom the system indexing.I have done this

    4.when i search from home page for an account which is enabled in the admin->search.I get

    HTTP: 500 Internal Server Error

    A search engine runtime error occurred. Please contact your System Administrator.

    Regards

    Sidhu

  • Hi Lori F

                     Fixed it, the elastic version was 2.4.0.I have down graded it to 1.4.4 as i using 7.7 and redone the above process and it was working.

    Regards

    Sidhu

  • Hi Lori F

                       I have done the system index

    Also made the elastic scheduler active

    But what i get is this in error.log file

     PHP Fatal error:  Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /<>/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php on line 41, referer: http:/<>/index.php?module=Administration&action=GlobalSearchSettings

    Regards

    Sidhu

1 2