I have upgraded magento to 2.4.5 and when i ran setup upgrade command I received this error

"Could not validate a connection to Elasticsearch. No alive nodes found in your cluster".

Elastic Search is running, I have checked. Also tried to restart es by

sudo systemctl restart elasticsearch

but not working. Please Help

2 Answers 2


I assume your elasticsearch engine is installed locally (on localhost) and is enabled/active (I also assume the version of your elastic search is 7)

this query will fix your issue:

update core_config_data set value='localhost' where path='catalog/search/elasticsearch7_server_hostname';

If your use docker or your architecture is different than a local lemp/lamp stack then you need to find the hostname where your elasticsearch is installed and modify the query accordingly

  • Hey I run the above command but still issue not resolved Aug 17, 2022 at 11:50
  • np, thanks for the feedback. Hope you get it sorted Aug 17, 2022 at 13:22
  • Yes I resolved it, It was due to different port number of ES in env file so i removed the port in env file, and now its working Aug 18, 2022 at 6:16

If you need error free access the site/terminal. Just try to disable given below modules

php bin/magento module:disable Magento_Elasticsearch Magento_InventoryElasticsearch Magento_Elasticsearch6 Magento_Elasticsearch7

Note: Before Disable module. You should check the first server/hosting provider side elasticsearch enable or disable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.