cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to run "bin/magento setup:upgrade" because of elasticsearch error

SOLVED

Unable to run "bin/magento setup:upgrade" because of elasticsearch error

Hi all,
I have migrate Magento 2.4.6 from a Plesk server to an other Plesk via plesk migration tool. 

When i try to run "php bin/magento setup:upgrade" i have the error:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

On "systemctl status elasticsearch" on console i have the follow:

[root@unruffled-raman ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; pre>
     Active: active (running) since Tue 2025-06-17 09:53:39 EEST; 5min ago
       Docs: https://www.elastic.co
   Main PID: 187964 (java)
      Tasks: 95 (limit: 126056)
     Memory: 10.2G
        CPU: 31.050s
     CGroup: /system.slice/elasticsearch.service
             ├─187964 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+>
             ├─188031 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.>
             └─188056 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux->

Elasticsearch its running.
Any idea? 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Unable to run "bin/magento setup:upgrade" because of elasticsearch error

Hi again, the solution was to uninstall elasticsearch 8 and install elasticsearch 7, for my magento 2.4.6


@Astergios wrote:

Hi all,
I have migrate Magento 2.4.6 from a Plesk server to an other Plesk via plesk migration tool. 

When i try to run "php bin/magento setup:upgrade" i have the error:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

On "systemctl status elasticsearch" on console i have the follow:

[root@unruffled-raman ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; pre>
     Active: active (running) since Tue 2025-06-17 09:53:39 EEST; 5min ago
       Docs: https://www.elastic.co
   Main PID: 187964 (java)
      Tasks: 95 (limit: 126056)
     Memory: 10.2G
        CPU: 31.050s
     CGroup: /system.slice/elasticsearch.service
             ├─187964 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+>
             ├─188031 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.>
             └─188056 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux->

Elasticsearch its running.
Any idea? 


 

View solution in original post

2 REPLIES 2

Re: Unable to run "bin/magento setup:upgrade" because of elasticsearch error

Hi @Astergios ,

 

When Magento can’t see Elasticsearch you’ll continue to get error even though the service is running under systemd.

 

Have you tried below?

curl -I http://127.0.0.1:9200/

 

You can replace 127.0.0.1 with elasticsearch host and 9200 with port on which elasticsearch is running.

 

You should get back something like HTTP/1.1 200 OK (or at least a JSON payload with your cluster name).

 

Recent elasticsearch installs default to enabled security. If you see prompts for username/password on a raw curl http://…:9200, you’ll need to add these creds into database as well.

 

Problem Solved? Accept as Solution!

 

Thanks

Ankit

Ankit Jasani

Re: Unable to run "bin/magento setup:upgrade" because of elasticsearch error

Hi again, the solution was to uninstall elasticsearch 8 and install elasticsearch 7, for my magento 2.4.6


@Astergios wrote:

Hi all,
I have migrate Magento 2.4.6 from a Plesk server to an other Plesk via plesk migration tool. 

When i try to run "php bin/magento setup:upgrade" i have the error:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

On "systemctl status elasticsearch" on console i have the follow:

[root@unruffled-raman ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; pre>
     Active: active (running) since Tue 2025-06-17 09:53:39 EEST; 5min ago
       Docs: https://www.elastic.co
   Main PID: 187964 (java)
      Tasks: 95 (limit: 126056)
     Memory: 10.2G
        CPU: 31.050s
     CGroup: /system.slice/elasticsearch.service
             ├─187964 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+>
             ├─188031 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.>
             └─188056 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux->

Elasticsearch its running.
Any idea?