title: Magento 2.4 Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
body: <p>I am trying to upgrade my Magento 2.3 store to 2.4. In trying to do so, when I try to run <code>bin/magento setup:upgrade</code> I receive the following error: <code>Could not validate a connection to Elasticsearch. No alive nodes found in your cluster</code></p>
  <p>Here is what I have so far.</p>
  <p>I am running nginx, here is the config file:</p>
  <pre><code>upstream panam_backend {
     server   php74:9000;
  }
  
  server {
      listen 80;
      server_name panam.localhost;
      set $MAGE_ROOT /var/www/html/panam.localhost;
  
      listen 443 ssl http2;
      ssl_certificate /var/www/html/panam.localhost/key/panam.localhost.crt;
      ssl_certificate_key /var/www/html/panam.localhost/key/panam.localhost.key;
  
      root $MAGE_ROOT/pub;
  
      index index.php;
      autoindex off;
      charset UTF-8;
      error_page 404 403 = /errors/404.php;
      #add_header &quot;X-UA-Compatible&quot; &quot;IE=Edge&quot;;
  
      # PHP entry point for setup application
      location ~* ^/setup($|/) {
          root $MAGE_ROOT;
          location ~ ^/setup/index.php {
              fastcgi_pass   panam_backend;
              fastcgi_index  index.php;
              fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
              include        fastcgi_params;
          }
  
          location ~ ^/setup/(?!pub/). {
              deny all;
          }
  
          location ~ ^/setup/pub/ {
              add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
          }
      }
  
      # PHP entry point for update application
      location ~* ^/update($|/) {
          root $MAGE_ROOT;
  
          location ~ ^/update/index.php {
              fastcgi_split_path_info ^(/update/index.php)(/.+)$;
              fastcgi_pass   panam_backend;
              fastcgi_index  index.php;
              fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
              fastcgi_param  PATH_INFO        $fastcgi_path_info;
              include        fastcgi_params;
          }
  
          # Deny everything but index.php
          location ~ ^/update/(?!pub/). {
              deny all;
          }
  
          location ~ ^/update/pub/ {
              add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
          }
      }
  
      location / {
          try_files $uri $uri/ /index.php?$args;
      }
  
      location /pub/ {
          location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
              deny all;
          }
          alias $MAGE_ROOT/pub/;
          add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
      }
  
      location /static/ {
          # Uncomment the following line in production mode
          # expires max;
  
          # Remove signature of the static files that is used to overcome the browser cache
          location ~ ^/static/version {
              rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
          }
  
          location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
              add_header Cache-Control &quot;public&quot;;
              add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
              expires +1y;
  
              if (!-f $request_filename) {
                  rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
              }
          }
          location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
              add_header Cache-Control &quot;no-store&quot;;
              add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
              expires    off;
  
              if (!-f $request_filename) {
                 rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
              }
          }
          if (!-f $request_filename) {
              rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
          }
          add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
      }
  
      location /media/ {
          try_files $uri $uri/ /get.php?$args;
  
          location ~ ^/media/theme_customization/.*\.xml {
              deny all;
          }
  
          location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
              add_header Cache-Control &quot;public&quot;;
              add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
              expires +1y;
              try_files $uri $uri/ /get.php?$args;
          }
          location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
              add_header Cache-Control &quot;no-store&quot;;
              add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
              expires    off;
              try_files $uri $uri/ /get.php?$args;
          }
          add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
      }
  
      location /media/customer/ {
          deny all;
      }
  
      location /media/downloadable/ {
          deny all;
      }
  
      location /media/import/ {
          deny all;
      }
  
      # PHP entry point for main application
      location ~ (index|get|static|report|404|503)\.php$ {
          try_files $uri =404;
          fastcgi_pass   panam_backend;
          fastcgi_buffers 16 16k;
          fastcgi_buffer_size 32k;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
          include        fastcgi_params;
  
      }
  
      location /_cluster/health {
            proxy_pass http://192.168.77.75:9250/_cluster/health;
         }
  
      gzip on;
      gzip_disable &quot;msie6&quot;;
  
      gzip_comp_level 6;
      gzip_min_length 1100;
      gzip_buffers 16 8k;
      gzip_proxied any;
      gzip_types
          text/plain
          text/css
          text/js
          text/xml
          text/javascript
          application/javascript
          application/x-javascript
          application/json
          application/xml
          application/xml+rss
          image/svg+xml;
      gzip_vary on;
  
      # Banned locations (only reached if the earlier PHP entry point regexes don't match)
      location ~* (\.php$|\.htaccess$|\.git) {
          deny all;
      }
  
  }
  #
  ## Optional override of deployment mode. We recommend you use the
  ## command 'bin/magento deploy:mode:set' to switch modes instead.
  ##
  ## set $MAGE_MODE default; # or production or developer
  ##
  ## If you set MAGE_MODE in server config, you must pass the variable into the
  ## PHP entry point blocks, which are indicated below. You can pass
  ## it in using:
  ##
  ## fastcgi_param  MAGE_MODE $MAGE_MODE;
  ##
  ## In production mode, you should uncomment the 'expires' directive in the /static/ location block
  </code></pre>
  <p>Here is the env.php file:</p>
  <pre><code>&lt;?php
  return [
      'cache_types' =&gt; [
          'config' =&gt; 1,
          'layout' =&gt; 1,
          'block_html' =&gt; 1,
          'collections' =&gt; 1,
          'reflection' =&gt; 1,
          'db_ddl' =&gt; 1,
          'eav' =&gt; 1,
          'customer_notification' =&gt; 1,
          'target_rule' =&gt; 1,
          'full_page' =&gt; 1,
          'config_integration' =&gt; 1,
          'config_integration_api' =&gt; 1,
          'translate' =&gt; 1,
          'config_webservice' =&gt; 1,
          'compiled_config' =&gt; 1,
          'vertex' =&gt; 1,
          'google_product' =&gt; 0
      ],
      'db' =&gt; [
          'connection' =&gt; [
              'default' =&gt; [
                  'dbname' =&gt; 'panam',
                  'host' =&gt; 'db',
                  'username' =&gt; 'root',
                  'password' =&gt; '',
                  'model' =&gt; 'mysql4',
                  'engine' =&gt; 'innodb',
                  'initStatements' =&gt; 'SET NAMES utf8;',
                  'active' =&gt; '1',
                  'profiler' =&gt; '1'
              ]
          ],
          'table_prefix' =&gt; ''
      ],
      'cache' =&gt; [
          'frontend' =&gt; [
              'default' =&gt; [
                  'backend' =&gt; 'Cm_Cache_Backend_Redis',
                  'backend_options' =&gt; [
                      'server' =&gt; 'redis',
                      'database' =&gt; '0',
                      'port' =&gt; '6379'
                  ]
              ],
              'page_cache' =&gt; [
                  'backend' =&gt; 'Cm_Cache_Backend_Redis',
                  'backend_options' =&gt; [
                      'server' =&gt; 'redis',
                      'port' =&gt; '6379',
                      'database' =&gt; '1',
                      'compress_data' =&gt; '0'
                  ]
              ]
          ]
      ],
      'MAGE_MODE' =&gt; 'developer',
      'backend' =&gt; [
          'frontName' =&gt; 'admin'
      ],
      'crypt' =&gt; [
          'key' =&gt; 'abfd843e41c08030189ad4ebaf1191f0'
      ],
      'resource' =&gt; [
          'default_setup' =&gt; [
              'connection' =&gt; 'default'
          ]
      ],
      'x-frame-options' =&gt; 'SAMEORIGIN',
      'session' =&gt; [
          'save' =&gt; 'redis',
          'redis' =&gt; [
              'host' =&gt; 'redis',
              'port' =&gt; '6379',
              'password' =&gt; '',
              'timeout' =&gt; '2.5',
              'persistent_identifier' =&gt; '',
              'database' =&gt; '2',
              'compression_threshold' =&gt; '2048',
              'compression_library' =&gt; 'gzip',
              'log_level' =&gt; '1',
              'max_concurrency' =&gt; '6',
              'break_after_frontend' =&gt; '5',
              'break_after_adminhtml' =&gt; '30',
              'first_lifetime' =&gt; '600',
              'bot_first_lifetime' =&gt; '60',
              'bot_lifetime' =&gt; '7200',
              'disable_locking' =&gt; '0',
              'min_lifetime' =&gt; '60',
              'max_lifetime' =&gt; '2592000'
          ]
      ],
      'install' =&gt; [
          'date' =&gt; 'Fri, 06 Apr 2018 22:04:26 +0000'
      ],
      'system' =&gt; [
          'default' =&gt; [
              'dev' =&gt; [
                  'debug' =&gt; [
                      'debug_logging' =&gt; '0'
                  ]
              ],
              'smile_elasticsuite_core_base_settings' =&gt; [
                  'es_client' =&gt; [
                      'servers' =&gt; '192.168.77.75:9250',
                      'enable_https_mode' =&gt; '0',
                      'enable_http_auth' =&gt; '0',
                      'http_auth_user' =&gt; '',
                      'http_auth_pwd' =&gt; ''
                  ]
              ]
          ]
      ]
  ];
  </code></pre>
  <p>Here is output of <code>curl -XGET 'http://192.168.77.75:9250'</code> on the host computer:</p>
  <pre><code>{
    &quot;name&quot; : &quot;ebrownserver&quot;,
    &quot;cluster_name&quot; : &quot;7.6&quot;,
    &quot;cluster_uuid&quot; : &quot;wWppBNI9SR29XtyhIZ-LnQ&quot;,
    &quot;version&quot; : {
      &quot;number&quot; : &quot;7.6.2&quot;,
      &quot;build_flavor&quot; : &quot;default&quot;,
      &quot;build_type&quot; : &quot;deb&quot;,
      &quot;build_hash&quot; : &quot;ef48eb35cf30adf4db14086e8aabd07ef6fb113f&quot;,
      &quot;build_date&quot; : &quot;2020-03-26T06:34:37.794943Z&quot;,
      &quot;build_snapshot&quot; : false,
      &quot;lucene_version&quot; : &quot;8.4.0&quot;,
      &quot;minimum_wire_compatibility_version&quot; : &quot;6.8.0&quot;,
      &quot;minimum_index_compatibility_version&quot; : &quot;6.0.0-beta1&quot;
    },
    &quot;tagline&quot; : &quot;You Know, for Search&quot;
  }
  </code></pre>
  <p>I've restarted nginx and elasticsearch many times, but it didn't help.</p>
  <p>Also, as far as my configuration goes, nginx is setup on the host computer while elasticsearch is on a separate server on the network. I don't know if that changes anything, but that's how it's setup right now.</p>
  <p>Also, elasticsearch used to be connected to a docker container on the host computer before it started causing a bunch of problems. The docker container had a different ip address than the one that is currently being used, so maybe a caching issue where it's trying to use the old ip address is occurring? Not sure, just throwing it out there.</p>
  <p>Let me know if you need anymore information.</p>