Elasticsuite: No alive nodes found in your cluster.

Created on 7 Jul 2018  路  16Comments  路  Source: Smile-SA/elasticsuite

Preconditions
After installing modules and enabling them, when I run bin/magento setup:upgrade, I get this error _'Smile_ElasticsuiteCatalog': Installing data... No alive nodes found in your cluster_. When _only_ 'Smile_ElasticsuiteCore' module is enabled, site is working but catalog is appearing blank.

Magento Version : 2.2.4, default Luma theme and demo products.
ElasticSuite Version : v5.3.2
Environment : Developer
Nginx, php 7.1.18

### Steps to reproduce

  1. Installed ES modules with phonetic and UCI
  2. Verified ES is running with "curl localhost:9200"
  3. Followed instructions: https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall

### Expected result

  1. Module should work as expected

### Actual result

  1. CLI message:
    Module 'Smile_ElasticsuiteCore':
    Module 'Smile_ElasticsuiteCatalog':
    Installing data... No alive nodes found in your cluster
  1. Log report:
    [2018-07-07 21:10:17] main.CRITICAL: No alive nodes found in your cluster {"exception":"[object] (Elasticsearch\Common\Exceptions\NoNodesAvailableException(code: 0): No alive nodes found in your cluster at /var/www/html/espmagento/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:51)"} []
needs update

Most helpful comment

I changed

 'system' => [
        'default' => [
            'smile_elasticsuite_core_base_settings' => [
                'es_client' => [
                    'servers' => 'elasticsearch:9200',
                    'enable_https_mode' => '0',
                    'enable_http_auth' => '1',
                ]
            ]
        ]
    ] 

to

'system' => [ 'default' => [ 'smile_elasticsuite_core_base_settings' => [ 'es_client' => [ 'servers' => 'elasticsearch:9200', 'enable_https_mode' => 0, 'enable_http_auth' => 1, ] ] ] ]

which resolved this issue for me. It appears the 0 as a string was being evaluated as true as per alexpoletaevs suggestion

All 16 comments

Hello, thank you for giving our module a try.

Which instructions did you follow in module install ? In fact, they are all optional if your ES server is running on http://localhost:9200

Could you show me anything related to elasticsuite/elasticsearch as it appears on the core_config_data table during install or in the app/etc/env.php file ?

Regards

Hi,
Followed this instruction: https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall
env.php:

<?php
return [
  'backend' => [
    'frontName' => 'admin_esp'
  ],
  'crypt' => [
    'key' => 'd1c386262377ac7ecee183b4ba2e7882'
  ],
  'db' => [
    'table_prefix' => '',
    'connection' => [
      'default' => [
        'host' => 'localhost',
        'dbname' => 'magentodb',
        'username' => 'magentouser',
        'password' => 'MagentoPWD123#',
        'active' => '1'
      ]
    ]
  ],
  'resource' => [
    'default_setup' => [
      'connection' => 'default'
    ]
  ],
  'x-frame-options' => 'SAMEORIGIN',
  'MAGE_MODE' => 'default',
  'session' => [
    'save' => 'files'
  ],
  'cache_types' => [
    'config' => 0,
    'layout' => 0,
    'block_html' => 0,
    'collections' => 0,
    'reflection' => 0,
    'db_ddl' => 0,
    'eav' => 0,
    'customer_notification' => 0,
    'config_integration' => 0,
    'config_integration_api' => 0,
    'full_page' => 0,
    'translate' => 0,
    'config_webservice' => 0
  ],
  'install' => [
    'date' => 'Mon, 02 Jul 2018 03:01:27 +0000'
  ],
  'system' => [
    'default' => [
      'smile_elasticsuite_core_base_settings' => [
        'es_client' => [
          'servers' => 'localhost:9200',
          'enable_https_mode' => 'false',
          'enable_http_auth' => 'false',
          'http_auth_user' => '',
          'http_auth_pwd' => ''
        ]
      ]
    ]
  ]
];

Also, there is not any row related to _elasticsuite/elasticsearch_ in _core_config_data_ .

Thanks.

Does the problem still occurs if you clean the cache before running the setup:upgrade script ?

Hi, I will give a try and let you know.
Thanks.

Hi @iRabi,

I close this one for having no feedback from you and not being able to reproduce the bug.

I faced the same issue. Is there any solution for this?

the next config fixed the problem for me:

'smile_elasticsuite_core_base_settings' => [
                'es_client' => [
                    'servers' => '127.0.0.1:9200',
                    'enable_https_mode' => 0,
                    'enable_http_auth' => 0,
                    'http_auth_user' => '',
                    'http_auth_pwd' => '',
                    'scheme' => 'http'
                ]
            ]

the problem is that the 'false' is a string, it returns true during validation and Magento tries to connect over https.

I'm having the same problem here is my config.

 'system' => [
        'default' => [
            'smile_elasticsuite_core_base_settings' => [
                'es_client' => [
                    'servers' => 'https://*****************.us-west-2.es.amazonaws.com:443',
                    'enable_https_mode' => '0',
                    'enable_http_auth' => '0',
                ]
            ]
        ]
    ] 

I changed

 'system' => [
        'default' => [
            'smile_elasticsuite_core_base_settings' => [
                'es_client' => [
                    'servers' => 'elasticsearch:9200',
                    'enable_https_mode' => '0',
                    'enable_http_auth' => '1',
                ]
            ]
        ]
    ] 

to

'system' => [ 'default' => [ 'smile_elasticsuite_core_base_settings' => [ 'es_client' => [ 'servers' => 'elasticsearch:9200', 'enable_https_mode' => 0, 'enable_http_auth' => 1, ] ] ] ]

which resolved this issue for me. It appears the 0 as a string was being evaluated as true as per alexpoletaevs suggestion

for anyone who is facing the same issue and coming from a docker-compose background!
just change the 'servers' value inapp/etc/env.phpto:in my case it waselasticsearch:9200` since my docker-compose was like

 elasticsearch:
    build: images/elasticsearch
    ports:
      - "9200:9200"
      - "9300:9300"

i am also facing same issues

I dono have idea

May I know the proceduere

Module 'Smile_ElasticsuiteCore':
Module 'Smile_ElasticsuiteCatalog':
Installing data... No alive nodes found in your cluster

check out the comments @LavanyaCS

jeez, having protocol in the host url would break the installation, removing http(s) from url in config fixed it for me.

the next config fixed the problem for me:

'smile_elasticsuite_core_base_settings' => [
                'es_client' => [
                    'servers' => '127.0.0.1:9200',
                    'enable_https_mode' => 0,
                    'enable_http_auth' => 0,
                    'http_auth_user' => '',
                    'http_auth_pwd' => '',
                    'scheme' => 'http'
                ]
            ]

the problem is that the 'false' is a string, it returns true during validation and Magento tries to connect over https.

works like a charm

Was this page helpful?
0 / 5 - 0 ratings