I recently attempted to update one of my servers running Heartbeat v6.6.2 to v6.7.0 and started receiving the following error message:
INFO pipeline/output.go:95 Connecting to backoff(elasticsearch(https://elasticsearch.example.com:443))
INFO elasticsearch/client.go:739 Attempting to connect to Elasticsearch version 6.4.2
pipeline/output.go:100 Failed to connect to backoff(elasticsearch(https://elasticsearch.example.com:443)): Connection marked as failed because the onConnect callback failed: cannot retrieve the elasticsearch license: unauthorized access, could not connect to the xpack endpoint, verify your credentials
As a further check, I ran the heartbeat test
command to test the connection to elasticsearch and received the following:
$ heartbeat test output -c heartbeat.yml
elasticsearch: https://elasticsearch.example.com:443...
parse url... OK
connection...
parse host... OK
dns lookup... OK
addresses: 3.86.58.90
dial up... OK
TLS...
security: server's certificate chain verification is enabled
handshake... OK
TLS version: TLSv1.2
dial up... OK
talk to server... ERROR Connection marked as failed because the onConnect callback failed: cannot retrieve the elasticsearch license: unauthorized access, could not connect to the xpack endpoint, verify your credentials
Note: I replaced my elasticsearch dns with elasticsearch.example.com above.
I have NGINX running in front of my Elasticsearch cluster which handles offloading basic authentication. I am able to replicate the problem with this minimal heartbeat.yml
heartbeat.monitors:
- type: icmp
hosts: ["localhost"]
schedule: "@every 10s"
output.elasticsearch:
hosts: ["https://elasticsearch.example.com:443"]
username: "my_basic_auth_username"
password: "my_basic_auth_password"
I believe that the problem is a result of this update: https://github.com/elastic/beats/pull/11296
Is there a reason Heartbeat now checks for an x-pack license? Is there a way to disable this functionality?