Global Search takes to home page

I have installed and setup Version 7.11.10 Sugar Version 6.5.25 (Build 344).

When we do a search in the Global Search, it goes to the Home Screen. No idea why this is happening. I tried everything, did repair and also cleared cache, but still no luck. Has anyone experienced this before and does anyone know how to fix it?

Hi, welcome to the Community! :tada:

That is indeed strange. Maybe your installation is not quite right yet.

Do you see a bunch of undefined labels in several screens? If so, then you need to fix ownerships/permissions so that SuiteCRM can read and write the files it needs to access.

You can also check your logs for more clues.

No I don’t see any label issues. What are the user access rights and where do we fix it?

I am not sure that is your problem, if you don’t see undefined labels.

I await any information from your logs.

You can also provide some more information about your server, it would help me try to diagnose.

Hi,

I have attached a URL of the video recording of the problem and also showing the logs. Not sure if that helps. If you need anything more do let me know.

Yes, that makes it very clear where your problem is. This problem will have more nasty manifestations, not only this one.

You need to review you cron jobs configuration. You set them up for the root user, you need to change that so that the jobs run from your web server user instead. Otherwise, every time the jobs run, a few files will be touched as root and their permissions will be ruined for the web server user. Then bits of the app will start failing randomly.

Go in Admin / Schedulers and see the cron job instructions at the bottom. Make sure you also remove the current entry in root’s crontab.

More info here:

When you’re done fixing that, you need to set correct ownerships and permissions one last time.

Supposing your web server user name (the one you found with the instruction above) was www-data, the commands would be these:

  sudo chown -R www-data:www-data .
  sudo chmod -R 755 .
  sudo chmod -R 775 cache custom modules themes data upload
  sudo chmod 775 config_override.php 2>/dev/null

Thank you. I followed all the instructions in the guide and did exactly what you suggested.

One thing that happens when I do a repair and rebuild (as suggested in the guide) is the following errors in the log.

Mon Mar 16 18:40:50 2020 [32052][1][FATAL] Exception handling in /var/www/crm.ourcompanydomain.com/public_html/include/MVC/Controller/SugarController.php:400
Mon Mar 16 18:40:50 2020 [32052][1][FATAL] Exception in Controller: Failed to parse Host URL ‘http://’
Mon Mar 16 18:40:50 2020 [32052][1][FATAL] backtrace:
#0 /var/www/crm.ourcompanydomain.com/public_html/lib/Search/ElasticSearch/ElasticSearchClientBuilder.php(177): SuiteCRM\Search\ElasticSearch\ElasticSearchClientBuilder::sanitizeHost(Array)
#1 /var/www/crm.ourcompanydomain.com/public_html/lib/Search/ElasticSearch/ElasticSearchClientBuilder.php(63): SuiteCRM\Search\ElasticSearch\ElasticSearchClientBuilder::loadFromSugarConfig()
#2 /var/www/crm.ourcompanydomain.com/public_html/lib/Search/ElasticSearch/ElasticSearchIndexer.php(87): SuiteCRM\Search\ElasticSearch\ElasticSearchClientBuilder::getClient()
#3 /var/www/crm.ourcompanydomain.com/public_html/lib/Search/ElasticSearch/ElasticSearchIndexer.php(583): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer->__construct()
#4 /var/www/crm.ourcompanydomain.com/public_html/modules/Administration/repairDatabase.php(179): SuiteCRM\Search\ElasticSearch\ElasticSearchIndexer::repairElasticsearchIndex()
#5 /var/www/crm.ourcompanydomain.com/public_html/modules/Administration/QuickRepairAndRebuild.php(142): include_once(’/var/www/crm.ga…’)
#6 /var/www/crm.ourcompanydomain.com/public_html/modules/Administration/QuickRepairAndRebuild.php(124): RepairAndClear->repairDatabase()
#7 /var/www/crm.ourcompanydomain.com/public_html/modules/Administration/views/view.repair.php(55): RepairAndClear->repairAndClearAll(Array, Array, false, true)
#8 /var/www/crm.ourcompanydomain.com/public_html/include/MVC/View/SugarView.php(226): ViewRepair->display()
#9 /var/www/crm.ourcompanydomain.com/public_html/include/MVC/Controller/SugarController.php(435): SugarView->process()
#10 /var/www/crm.ourcompanydomain.com/public_html/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#11 /var/www/crm.ourcompanydomain.com/public_html/include/MVC/SugarApplication.php(113): SugarController->execute()
#12 /var/www/crm.ourcompanydomain.com/public_html/index.php(52): SugarApplication->execute()
#13 {main}

Since these have the word elastic search I was wondering if this was something related? I am able to reproduce this consistently.

Hi,

Also both the host_name and site_url are correct. I checked again.

The details of the installation are as follows

Operating System:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial

PHP Details:
PHP Version 7.0.33-0ubuntu0.16.04.12

SuiteCRM Version:
Version 7.11.12
Sugar Version 6.5.25 (Build 344)

That missing host URL is from the Elastic search config, but the fact that it’s causing trouble when you haven’t even enabled Elastic Search, is a bug:

A workaround might be to comment out this line until there is a better fix:

That error is being generated during Quick Repair and Rebuild, by the way. It’s better to make sure that QR &R isn’t interrupted.

Hello,

Ok its fixed. This is what I did.

  1. Back-up the database
  2. Enabled install in the config.php
  3. Ran the installer completely
  4. Imported the database back

Now the Global Search is working :slight_smile:

Thanks for the help.

We had the same issue during the migration from Dev server to Production because we have upgraded the SuiteCRM from a quite old version to the latest version. so config was missing with the default search engine settings.

This may help if anybody has something similar issue.

admin → Search Settings