# Failed to connect to Elastic search backend.make sure it is running and healthy

**URL:** <https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 23, 2021, 10:45pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149 "2021-03-23T22:45:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [March 23, 2021, 10:45pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/1 "2021-03-23T22:45:56Z")

</div>

I am trying to set app search on my linux server. All the prerequisites are done and I am at the last step to start it.

It gives the below 2 errors

- Failed to connect to Elasticsearch backend.Make sure it is running and healthy.  
-PKIX path building failed :sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Has any one face this issue??

---

<div class="post-metadata">

**Author:** ![Vadim\_Yakhin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vadim_yakhin/32/56723_2.png) [@Vadim\_Yakhin](https://discuss.elastic.co/u/Vadim_Yakhin)\
**Post date:** [March 24, 2021, 1:56pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/2 "2021-03-24T13:56:55Z")

</div>

Hi Saqeeb,

This StackOverflow post has some solutions to this error message, have you tried them?

> <https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ>

---

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [March 24, 2021, 3:08pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/3 "2021-03-24T15:08:02Z")

</div>

Thanks for your response..

Yes we tried the following along with the link you shared:

> **[Installation | Elastic Enterprise Search Documentation \[7.12\] | Elastic](https://www.elastic.co/guide/en/enterprise-search/7.12/installation.html)**

[https://www.bmc.com/blogs/install-elastic-enterprise-search/](https://www.bmc.com/blogs/install-elastic-enterprise-search/)

> <https://stackoverflow.com/questions/63927566/why-doesnt-my-elastic-enterprise-search-configuration-work>

The request goes like this when trying to start it, if that can help in answering:  
2021-03-24T14:51:05.943+00:00][6313][2002][es][DEBUG]: [pre-flight] {  
"request": {  
"url": "https://.domain.com:9200",  
"method": "get",  
"headers": {  
"Authorization": "[FILTERED]",  
"Content-Type": "application/json",  
"User-Agent": "Faraday v0.17.3"  
},  
"params": null,  
"body": null  
}

---

<div class="post-metadata">

**Author:** ![Vadim\_Yakhin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vadim_yakhin/32/56723_2.png) [@Vadim\_Yakhin](https://discuss.elastic.co/u/Vadim_Yakhin)\
**Post date:** [March 24, 2021, 3:26pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/4 "2021-03-24T15:26:14Z")

</div>

We don't recommend using unofficial installation docs.

[The article](https://www.bmc.com/blogs/install-elastic-enterprise-search/) that you linked has instructions for installing Enterprise Search 7.5.0 (which at that time was what is currently called Workplace Search). It could be that instructions in that article somehow broke your setup.

I recommend starting from scratch by only following the instructions in the official docs: [Installation | Elastic Enterprise Search Documentation [7.12] | Elastic](https://www.elastic.co/guide/en/enterprise-search/7.12/installation.html)

Let me know if you still see the error after going through the instructions.

---

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [March 24, 2021, 5:34pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/5 "2021-03-24T17:34:23Z")

</div>

Yes.. Our team tried reinstalling the enterprise search using the link you provided(v7.12) but no luck. We have the same error again.

Note: This is on the Linux server.

---

<div class="post-metadata">

**Author:** ![Vadim\_Yakhin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vadim_yakhin/32/56723_2.png) [@Vadim\_Yakhin](https://discuss.elastic.co/u/Vadim_Yakhin)\
**Post date:** [March 24, 2021, 5:58pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/6 "2021-03-24T17:58:04Z")

</div>

I wonder if it's the problem with Enterprise Search or Elasticsearch.

1. Are there any errors in Elasticsearch logs?
2. What do you see when you access the Elasticsearch endpoint? For local setup it's [http://localhost:9200](http://localhost:9200) (you might need to access a different endpoint depending on where Elasticsearch is being run).

---

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [March 24, 2021, 6:39pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/7 "2021-03-24T18:39:03Z")

</div>

There is no much details in logs except that says App-Search has tried to connect.

Elasticsearch is up and running with below response with below response on curl:

Enter host password for user 'elastic':  
{  
"name" : "servername",  
"cluster\_name" : "elasticsearch",  
"cluster\_uuid" : "FmsLHT3yRw-p8Hz3ZwfLiw",  
"version" : {  
"number" : "7.11.1",  
"build\_flavor" : "default",  
"build\_type" : "rpm",  
"build\_hash" : "ff17057114c2199c9c1bbecc727003a907c0db7a",  
"build\_date" : "2021-02-15T13:44:09.394032Z",  
"build\_snapshot" : false,  
"lucene\_version" : "8.7.0",  
"minimum\_wire\_compatibility\_version" : "6.8.0",  
"minimum\_index\_compatibility\_version" : "6.0.0-beta1"  
},  
"tagline" : "You Know, for Search"  
}

Even Kibana is up and running on same server.

---

<div class="post-metadata">

**Author:** ![Vadim\_Yakhin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vadim_yakhin/32/56723_2.png) [@Vadim\_Yakhin](https://discuss.elastic.co/u/Vadim_Yakhin)\
**Post date:** [March 24, 2021, 7:52pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/8 "2021-03-24T19:52:30Z")

</div>

I found the error on this page: [https://www.elastic.co/guide/en/elasticsearch/reference/current/trb-security-sslhandshake.html:](https://www.elastic.co/guide/en/elasticsearch/reference/current/trb-security-sslhandshake.html:)

> `sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target` and `javax.net.ssl.SSLException: Received fatal alert: certificate_unknown`
> 
> This `SunCertPathBuilderException` indicates that a certificate was returned during the handshake that is not trusted. This message is seen on the client side of the connection. The `SSLException` is seen on the server side of the connection. The CA certificate that signed the returned certificate was not found in the `keystore` or `truststore` and needs to be added to trust this certificate.

I don't understand the error, but I think there's a problem with Elasticsearch configuration that prevents Enterprise Search from connecting to it.

1. Has your Elasticsearch instance been used for anything other than Enterprise Search (in other words, is it not a fresh download)? If yes, does the problem appear if you point Enterprise Search to a fresh Elasticsearch instance?

2. Could you send the contents of your config/elasticsearch.yml file?

---

<div class="post-metadata">

**Author:** ![saqib619](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@saqib619](https://discuss.elastic.co/u/saqib619)\
**Post date:** [March 24, 2021, 9:12pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/9 "2021-03-24T21:12:43Z")

</div>

This is a fresh server. We setup the elasticsearch and kibana first. Now we are trying to install app search.  
No other dependencies.

Below is the elasticsearch.yml file. For masking purpose I have replaced the actual value by "example" for some values. But otherwise it is as in the server.

# ======================== Elasticsearch Configuration =========================

# 

# NOTE: Elasticsearch comes with reasonable defaults for most settings.

# Before you set out to tweak and tune the configuration, make sure you

# understand what are you trying to accomplish and the consequences.

# 

# The primary way of configuring a node is via this file. This template lists

# the most important settings you may want to configure for a production cluster.

# 

# Please consult the documentation for further information on configuration options:

# [Elasticsearch Reference | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/index.html)

# 

# ---------------------------------- Cluster -----------------------------------

# 

# Use a descriptive name for your cluster:

# 

#cluster.name:

# 

# ------------------------------------ Node ------------------------------------

# 

# Use a descriptive name for the node:

# 

node.name: example

# 

# Add custom attributes to the node:

# 

#node.attr.rack: r1

# 

# ----------------------------------- Paths ------------------------------------

# 

# Path to directory where to store the data (separate multiple locations by comma):

# 

path.data: /vol/data/elasticsearch

# 

# Path to log files:

# 

path.logs: /var/log/elasticsearch

# 

# ----------------------------------- Memory -----------------------------------

# 

# Lock the memory on startup:

# 

#bootstrap.memory\_lock: false

# 

# Make sure that the heap size is set to about half the memory available

# on the system and that the owner of the process is allowed to use this

# limit.

# 

# Elasticsearch performs poorly when the system is swapping the memory.

# 

# ---------------------------------- Network -----------------------------------

transport.tcp.port: 9300

# 

# Set the bind address to a specific IP (IPv4 or IPv6):

# 

network.host: [_local_, localhost, 10.196.242.82, example]

# Set a custom port for HTTP:

# 

#http.port: 9200

# 

# For more information, consult the network module documentation.

# 

# --------------------------------- Discovery ----------------------------------

# 

# Pass an initial list of hosts to perform discovery when this node is started:

# The default list of hosts is ["127.0.0.1", "[::1]"]

# 

discovery.seed\_hosts: ["example"]

# 

# Bootstrap the cluster using an initial set of master-eligible nodes:

# 

cluster.initial\_master\_nodes: ["example"]

# 

# For more information, consult the discovery and cluster formation module documentation.

# 

# ---------------------------------- Gateway -----------------------------------

# 

# Block initial recovery after a full cluster restart until N nodes are started:

# 

#gateway.recover\_after\_nodes: 3

# 

# For more information, consult the gateway module documentation.

# 

# ---------------------------------- Various -----------------------------------

# 

# Require explicit names when deleting indices:

# 

#action.destructive\_requires\_name: true  
gateway.recover\_after\_data\_nodes: 1  
gateway.expected\_data\_nodes: 1  
action.auto\_create\_index: .kibana,.security,.monitoring\*,.watches,.triggered\_watches,.watcher-history\*,.ml\*  
xpack.security.transport.ssl.enabled: true  
xpack.security.transport.ssl.verification\_mode: certificate  
xpack.security.transport.ssl.keystore.path: elastic-node.p12  
xpack.security.transport.ssl.truststore.path: elastic-node.p12  
xpack.security.enabled: true  
xpack.security.http.ssl.enabled: true  
xpack.security.http.ssl.key: example.key  
xpack.security.http.ssl.certificate: example.cer  
xpack.security.http.ssl.certificate\_authorities: example.cer  
xpack.security.authc.api\_key.enabled: true

---

<div class="post-metadata">

**Author:** ![Vadim\_Yakhin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vadim_yakhin/32/56723_2.png) [@Vadim\_Yakhin](https://discuss.elastic.co/u/Vadim_Yakhin)\
**Post date:** [March 25, 2021, 2:23pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/10 "2021-03-25T14:23:02Z")

</div>

This config has many options that are not listed in the Enterprise Search docs.  
Looks like Elasticsearch security is not configured correctly and that prevents Enterprise Search from connecting to it.

I'm afraid I won't be able to help with the Elasticsearch configuration. I recommend asking for help on the Elasticsearch forum: [Elasticsearch - Discuss the Elastic Stack](https://discuss.elastic.co/c/elastic-stack/elasticsearch/6)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 22, 2021, 2:23pm UTC](https://discuss.elastic.co/t/failed-to-connect-to-elastic-search-backend-make-sure-it-is-running-and-healthy/268149/11 "2021-04-22T14:23:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
