Facing error while starting kibana & trying to connect to elasticsearch version 8.5.1

Hi Everyone,

w.r.t suggetion given by Devid over post :

I tried both ways, (FYI : I am testing this on kibana plugin development environment)
supplied below values to respective parameters to config/kibana.yml

  1. elasticsearch username & password to parameters:

    elasticsearch.username: "kibana_system" // as well as "elastic"
    elasticsearch.password: "ENCRYPTED_VALUE"

  2. elasticsearch service token :

    elasticsearch.serviceAccountToken: "ENCRYPTED_VALUE"

I am still getting the same error,

On kibana terminal :

[2024-05-21T12:50:12.756+05:30][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. socket hang up - Local: 127.0.0.1:64610, Remote: 127.0.0.1:9200

& On elasticsearch terminal :

2024-05-21T12:50:12,754][WARN ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [Sunils-MacBook-Pro.local] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/127.0.0.1:9200, remoteAddress=/127.0.0.1:64610}

Additional info : Below are the parameters mentioned on elasticsearch.yml

# Enable security features
xpack.security.enabled: true

xpack.security.enrollment.enabled: true

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["Sunils-MacBook-Pro.local"]

# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: 0.0.0.0

thankful to have some fix.

This error message indicates that Elasticsearch received an http request although it's expecting an https request.

2024-05-21T12:50:12,754][WARN ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [Sunils-MacBook-Pro.local] received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/127.0.0.1:9200, remoteAddress=/127.0.0.1:64610}

Check that Kibana is using https as the protocol in that case.

Hi David,

Activated this parameter to config/kibana.yml,

elasticsearch.hosts: ["https://localhost:9200"]

& now below is the error message on kibana terminal :

2024-05-21T14:20:31.363+05:30][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. self signed certificate in certificate chain

Even tried activating below parameters :

# server.ssl.enabled: true
# server.ssl.certificate: /Users/sunil/Documents/workspace/elasticsearch-8.5.1/config/certs/http_ca.crt
# server.ssl.key: /Users/sunil/Documents/workspace/elasticsearch-8.5.1/config/certs/http.p12

And

elasticsearch.ssl.certificate: /Users/sunil/Documents/workspace/elasticsearch-8.5.1/config/certs/http_ca.crt
elasticsearch.ssl.key: /Users/sunil/Documents/workspace/elasticsearch-8.5.1/config/certs/http.p12

below are the error messages on terminal :

[2024-05-21T14:20:31.363+05:30][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. self signed certificate in certificate chain

FATAL  Error: error:0909006C:PEM routines:get_name:no start line
 server crashed  with status code 1

[2024-05-21T14:46:52.369+05:30][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. error:0909006C:PEM routines:get_name:no start line

I think it's not pointing to the expected certificate format. Not an expert on this. I'm usually just using docker compose which makes my life easier.

So may be check the documentation to find out what are the expected settings?

1 Like

Sure David, Thanks for your valuable suggestions :+1:

Hi All,

I am referring this post which is more relevant to my issue,

In my case I am using kibana plugin development environment & when I am trying to invoke enrollment process process using "yarn start" it is taking me to below error on kibana terminal :

[2024-05-22T10:52:31.044+05:30][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. socket hang up - Local: 127.0.0.1:60140, Remote: 127.0.0.1:9200

As per documentation : Start the Elastic Stack with security enabled automatically | Elasticsearch Guide [8.13] | Elastic

I tried below step :

  • Detached mode (non-browser)Run the kibana-setup tool and pass the generated enrollment token with the --enrollment-token parameter.

bin/kibana-setup --enrollment-token

As "bin/kibana-setup" not exist on kibana plugin development environment I tried executing the script manually from location :

Sunils-MacBook-Pro:scripts sunil$ pwd
/Users/sunil/Documents/workspace/kibana/src/dev/build/tasks/bin/scripts

Sunils-MacBook-Pro:scripts sunil$ ./kibana-setup --enrollment-token [ENCRYPTED_TEXT]
**unable to find usable node.js executable.**

Looking for help, thanks in advance.

@ikakavas , Elastic Team,

Looking for help reg. above issue