Issue with Elasticsearch Connector 8.0.0-alpha3 - "No alive nodes" error after upgrade

Created on 20 February 2025, about 2 months ago

Problem/Motivation

Hello, I recently upgraded from Elasticsearch Connector 7.0-alpha to 8.0.0-alpha3, and now I am facing an issue where the connection to Elasticsearch fails, preventing indexing from working. Previously, with Elasticsearch Connector 7.0-alpha and Elasticsearch 7.13.0 (Docker), everything was working fine: the connection was established, and indexing was successful. After upgrading to Elasticsearch Connector 8.0.0-alpha3 and Elasticsearch 8.15.5 (Docker), I now get the following error when running drush sapi-i:

> [error] Retry 0: Idle timeout reached for "http://elasticsearch:9200/index_1/_bulk".

> [error] Elastic\Transport\Exception\NoNodeAvailableException: No alive nodes. All the 1 nodes seem to be down. in Elastic\Transport\NodePool\SimpleNodePool->nextNode() (line 77 of /home/appli/drupal/vendor/elastic/transport/src/NodePool/SimpleNodePool.php).

> [notice] An error occurred during indexing on Index 1: No alive nodes. All the 1 nodes seem to be down. Environment Details

Environment Details:

  • Previous working setup:
    • Elasticsearch Connector 7.0-alpha
    • Elasticsearch 7.13.0 (Docker)
  • Current setup (failing):
    • Elasticsearch Connector 8.0.0-alpha3
    • Elasticsearch 8.15.5 (Docker)
    • Drupal version: 11
    • PHP version: 8.3
    • Search API module version : 1.37.0

 

Docker Setup:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.15.5
    environment:
        - discovery.type=single-node
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        - xpack.security.enabled=false
        - xpack.security.http.ssl.enabled=false

Elasticsearch Connector Cluster Config:

uuid: 5c37f1be-2ff5-4dc9-923d-6f0ba52fa122
status: '1'
cluster_id: cluster
name: Cluster
url: 'http://elasticsearch:9200'
options:
  multiple_nodes_connection: false
  use_authentication: 0
  authentication_type: Basic
  username: ''
  password: ''
  timeout: '3'

Search API Server Config:

uuid: e21e0193-2c05-4098-8077-fe8f013e659a
langcode: fr-FR
status: true
dependencies:
  module:
    - elasticsearch_connector
id: server_elasticsearch
name: 'Server ElasticSearch'
backend: elasticsearch
backend_config:
  connector: standard
  connector_config:
    url: 'http://elasticsearch:9200'
    enable_debug_logging: true
  advanced:
    fuzziness: auto
    prefix: ''
    suffix: ''
    synonyms:
      - ''

Cluster Status & Issue Debugging:

Running curl -X GET "http://elasticsearch:9200/_cluster/health?pretty" returns:

{
  "cluster_name": "docker-cluster",
  "status": "red",
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "active_primary_shards": 0,
  "active_shards": 0,
  "unassigned_shards": 4,
  "active_shards_percent_as_number": 0.0
}

</code></p>
<p>Running curl -X GET "http://elasticsearch:9200":&nbsp;</p>
<p><code>
  {
  "name" : "49f38a604a8e",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "voBwOO8BTHSWZIS_9AQUuw",
  "version" : {
    "number" : "8.15.5",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "b10896bcfe167cce44a84ba2771d101fb596d40d",
    "build_date" : "2024-11-21T22:06:13.985834967Z",
    "build_snapshot" : false,
    "lucene_version" : "9.11.1",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

Running curl -X GET "http://elasticsearch:9200/_cat/shards?v" shows that all shards are UNASSIGNED.

 

πŸ’¬ Support request
Status

Active

Version

8.0

Component

Elasticsearch Connector

Created by

πŸ‡²πŸ‡¦Morocco youssef.maaddi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @youssef.maaddi
  • πŸ‡«πŸ‡·France francoisduclos56@gmail.com

    Hello,

    We encountered the same issue after our upgrade from 7.x to 8.x version, and after some digging it seems
    that hook elasticsearch_connector_update_9800 did not upgrade properly our ES cluster URL for the configuration update.

    It seems it ended up setting default settings from elasticsearch_connector/tests/modules/elasticsearch_connector_test/config/install/search_api.server.elasticsearch_server.yml to the active configuration in database, hence breaking connection to ES cluster.

    What we did to solve the problem was to take the new 8.x configuration located at elasticsearch_connector/tests/modules/elasticsearch_connector_test/config/install/search_api.server.elasticsearch_server.yml and copy/paste old values from our old
    cluster config file (elasticsearch_connector.cluster.[your_cluster_name].yml) to match and after a config import it restored our connection to ES cluster (we did not need to update the index btw).

    NB : we had to change config dependency from this

    dependencies:
      module:
        - elasticsearch

    to this

    dependencies:
      module:
        - elasticsearch_connector

    Otherwise config import obviously wasn't happy.

    NB bis : hooks elasticsearch_connector_update_9801 and elasticsearch_connector_update_9802 delete previously migrated configs so in order to get your old values you'll have to fetch them from your config/sync folder

    Hope it helps,

    François

  • πŸ‡³πŸ‡΄Norway steinmb

    Think it is safe to classify this as a bug in hook_update_N() running upgrade from D7. Also seems to be a 8.x beta blocker.

Production build 0.71.5 2024