7.11.4 Global Search by ES ERROR #3727

Open
opened 2026-02-20 16:09:07 -05:00 by deekerman · 2 comments
Owner

Originally created by @cekowu on GitHub (May 13, 2019).

Issue

Expected Behavior

Actual Behavior

Possible Fix

Steps to Reproduce

  1. Config es server
  2. Config SuiteCRM search enigine by ES
  3. Search "_type:Accounts"
    4.Response "Error
    Contact an administrator if the problem persists. More information available in the logs."
    debug log:
    Mon May 13 08:52:21 2019 [9526][1][FATAL] [ERROR] [SearchThrowableHandler] Mon May 13 08:52:21 2019 [9526][1][FATAL] [ERROR] [SearchThrowableHandler] SuiteCRM\Exception\Exception: [SuiteCRM] Error retrieveing bean: Accounts [86ee02b3-97d3-47b3-bd6d-9e1035daff3a] in /data/www/html/SuiteCRM/7.11/lib/Search/SearchResults.php:131 Stack trace: #0 /data/www/html/SuiteCRM/7.11/lib/Search/UI/SearchResultsController.php(122): SuiteCRM\Search\SearchResults->getHitsAsBeans() #1 /data/www/html/SuiteCRM/7.11/lib/Search/SearchEngine.php(65): SuiteCRM\Search\UI\SearchResultsController->display() #2 /data/www/html/SuiteCRM/7.11/lib/Search/SearchEngine.php(41): SuiteCRM\Search\SearchEngine->displayResults(Object(SuiteCRM\Search\SearchQuery), Object(SuiteCRM\Search\SearchResults)) #3 /data/www/html/SuiteCRM/7.11/lib/Search/SearchWrapper.php(77): SuiteCRM\Search\SearchEngine->searchAndDisplay(Object(SuiteCRM\Search\SearchQuery)) #4 /data/www/html/SuiteCRM/7.11/modules/Home/Search.php(50): SuiteCRM\Search\SearchWrapper::searchAndDisplay(Object(SuiteCRM\Search\SearchQuery)) #5 /data/www/html/SuiteCRM/7.11/include/MVC/View/SugarView.php(834): include_once('/data/www/html/...') #6 /data/www/html/SuiteCRM/7.11/include/MVC/View/views/view.classic.php(72): SugarView->includeClassicFile('modules/Home/Se...') #7 /data/www/html/SuiteCRM/7.11/include/MVC/View/SugarView.php(226): ViewClassic->display() #8 /data/www/html/SuiteCRM/7.11/include/MVC/Controller/SugarController.php(435): SugarView->process() #9 /data/www/html/SuiteCRM/7.11/include/MVC/Controller/SugarController.php(375): SugarController->processView() #10 /data/www/html/SuiteCRM/7.11/include/MVC/SugarApplication.php(113): SugarController->execute() #11 /data/www/html/SuiteCRM/7.11/index.php(52): SugarApplication->execute() #12 {main}

Context

Your Environment

  • SuiteCRM Version used:7.11.4
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)):
  • Environment name and version (e.g. MySQL, PHP 7):
  • Operating System and version (e.g Ubuntu 16.04):
Originally created by @cekowu on GitHub (May 13, 2019). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> #### Expected Behavior <!--- Tell us what should happen --> #### Actual Behavior <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Config es server 2. Config SuiteCRM search enigine by ES 3. Search "_type:Accounts" 4.Response "Error Contact an administrator if the problem persists. More information available in the logs." debug log: `Mon May 13 08:52:21 2019 [9526][1][FATAL] [ERROR] [SearchThrowableHandler] Mon May 13 08:52:21 2019 [9526][1][FATAL] [ERROR] [SearchThrowableHandler] SuiteCRM\Exception\Exception: [SuiteCRM] Error retrieveing bean: Accounts [86ee02b3-97d3-47b3-bd6d-9e1035daff3a] in /data/www/html/SuiteCRM/7.11/lib/Search/SearchResults.php:131 Stack trace: #0 /data/www/html/SuiteCRM/7.11/lib/Search/UI/SearchResultsController.php(122): SuiteCRM\Search\SearchResults->getHitsAsBeans() #1 /data/www/html/SuiteCRM/7.11/lib/Search/SearchEngine.php(65): SuiteCRM\Search\UI\SearchResultsController->display() #2 /data/www/html/SuiteCRM/7.11/lib/Search/SearchEngine.php(41): SuiteCRM\Search\SearchEngine->displayResults(Object(SuiteCRM\Search\SearchQuery), Object(SuiteCRM\Search\SearchResults)) #3 /data/www/html/SuiteCRM/7.11/lib/Search/SearchWrapper.php(77): SuiteCRM\Search\SearchEngine->searchAndDisplay(Object(SuiteCRM\Search\SearchQuery)) #4 /data/www/html/SuiteCRM/7.11/modules/Home/Search.php(50): SuiteCRM\Search\SearchWrapper::searchAndDisplay(Object(SuiteCRM\Search\SearchQuery)) #5 /data/www/html/SuiteCRM/7.11/include/MVC/View/SugarView.php(834): include_once('/data/www/html/...') #6 /data/www/html/SuiteCRM/7.11/include/MVC/View/views/view.classic.php(72): SugarView->includeClassicFile('modules/Home/Se...') #7 /data/www/html/SuiteCRM/7.11/include/MVC/View/SugarView.php(226): ViewClassic->display() #8 /data/www/html/SuiteCRM/7.11/include/MVC/Controller/SugarController.php(435): SugarView->process() #9 /data/www/html/SuiteCRM/7.11/include/MVC/Controller/SugarController.php(375): SugarController->processView() #10 /data/www/html/SuiteCRM/7.11/include/MVC/SugarApplication.php(113): SugarController->execute() #11 /data/www/html/SuiteCRM/7.11/index.php(52): SugarApplication->execute() #12 {main} ` #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used:7.11.4 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): * Environment name and version (e.g. MySQL, PHP 7): * Operating System and version (e.g Ubuntu 16.04):
Author
Owner

@cekowu commented on GitHub (May 13, 2019):

rebuild the index and try again to get bean, but it seem rebuild faild in ES, it leads this issue
public function getHitsAsBeans()
{
$hits = $this->hits;
$parsed = [];

    foreach ($hits as $module => $beans) {
        foreach ((array)$beans as $bean) {
            $obj = BeanFactory::getBean($module, $bean);
            
            // if a search found a bean but suitecrm does not, it could happens
            // maybe the bean is deleted but elsasticsearch is not re-indexing yet.
            // so at this point we trying to rebuild the index and try again to get bean:
            if (!$obj) {
                ElasticSearch\ElasticSearchIndexer::repairElasticsearchIndex();
                $obj = BeanFactory::getBean($module, $bean);
            }
            if (!$obj) {
                throw new Exception('Error retrieveing bean: ' . $module . ' [' . $bean . ']');
            }
            $obj->load_relationships();
            $fieldDefs = $obj->getFieldDefinitions();
            $objUpdatedLinks = $this->updateFieldDefLinks($obj, $fieldDefs);
            $parsed[$module][] = $objUpdatedLinks;
        }
    }

    return $parsed;
}
@cekowu commented on GitHub (May 13, 2019): rebuild the index and try again to get bean, but it seem rebuild faild in ES, it leads this issue public function getHitsAsBeans() { $hits = $this->hits; $parsed = []; foreach ($hits as $module => $beans) { foreach ((array)$beans as $bean) { $obj = BeanFactory::getBean($module, $bean); // if a search found a bean but suitecrm does not, it could happens // maybe the bean is deleted but elsasticsearch is not re-indexing yet. // so at this point we trying to rebuild the index and try again to get bean: if (!$obj) { ElasticSearch\ElasticSearchIndexer::repairElasticsearchIndex(); $obj = BeanFactory::getBean($module, $bean); } if (!$obj) { throw new Exception('Error retrieveing bean: ' . $module . ' [' . $bean . ']'); } $obj->load_relationships(); $fieldDefs = $obj->getFieldDefinitions(); $objUpdatedLinks = $this->updateFieldDefLinks($obj, $fieldDefs); $parsed[$module][] = $objUpdatedLinks; } } return $parsed; }
Author
Owner

@oc666 commented on GitHub (Nov 24, 2019):

After adding continue; inside the 2nd if(!$obj) - the issue fixed.

@oc666 commented on GitHub (Nov 24, 2019): After adding _continue;_ inside the 2nd _if(!$obj)_ - the issue fixed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#3727
No description provided.