Mattermost Elasticsearch Connection Test Failure

Problem

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

  • The following entry is observed in the system log:

{"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:

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

Cause

Unknown

Workaround

Set the Enable Cluster Sniffing to false based on step d in the documentation:

  • Note: For AWS Elasticsearch this field should be set to false .