# Mattermost Elasticsearch Connection Test Failure

**URL:** <https://forum.mattermost.com/t/mattermost-elasticsearch-connection-test-failure/7342>\
**Category:** Troubleshooting\
**Created:** [May 22, 2019, 2:45am UTC](https://forum.mattermost.com/t/mattermost-elasticsearch-connection-test-failure/7342 "2019-05-22T02:45:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [May 22, 2019, 2:45am UTC](https://forum.mattermost.com/t/mattermost-elasticsearch-connection-test-failure/7342/1 "2019-05-22T02:45:33Z")

</div>

## Problem

- Clicking **Test Connection** on Elasticsearch configuration shows the following error -❗ **Test Failure: Connecting to Elasticsearch server failed**

- The following entry is observed in the system log:

```auto
{"level":"error","ts":XXXXX,"caller":"elasticsearch/aggregation_job.go:63","msg":"Worker EnterpriseElasticsearchAggregator: Failed to Create Client Elasticsearch.createClient: Setting up Elasticsearch Client Failed, no active connection found: no Elasticsearch node available","workername":"EnterpriseElasticsearchAggregator"}
{"level":"error","ts":XXXXX,"caller":"app/server.go:678","msg":"Elasticsearch.createClient: Setting up Elasticsearch Client Failed, no active connection found: no Elasticsearch node available"}
{"level":"error","ts":XXXXX,"caller":"elasticsearch/indexing_job.go:74","msg":"Worker EnterpriseElasticsearchIndexer: Failed to Create Client Elasticsearch.createClient: Setting up Elasticsearch Client Failed, no active connection found: no Elasticsearch node available","workername":"EnterpriseElasticsearchIndexer"}
{"level":"info","ts":XXXXX,"caller":"app/server.go:305","msg":"Stopping Server..."}

```

- The username and password used for authentication is correct

## Environment

- Elasticsearch v6.4.3
- CentOS Linux release 7.6.1810 (Core)
- Mattermost Version 5.8.0

## Diagnosis

The **Enable Cluster Sniffing** feature is set to **true** in the Elasticsearch settings:

```auto
"ElasticsearchSettings": { 
...
"Sniff": true
...
}

```

## Cause

Unknown

## Workaround

Set the **Enable Cluster Sniffing** to **false** based on step d in the [documentation](https://docs.mattermost.com/deployment/elasticsearch.html#configuring-elasticsearch-in-mattermost):

> - Note: For AWS Elasticsearch this field should be set to `false` .
