Thursday, March 31, 2022

[SOLVED] Unable to start kibana 5.x: "No endpoint or operation is available at [_xpack]" and too many redirects

First of all - if this post helps you, write a comment, let me know that it is useful :)

Preface

I tried to run some legacy stuff with docker-compose, elasticsearch 5.x and kibana. It worked at first. But then I did some changes and it wasn't working. Problem wasn't obvious. Since this is a legacy thing and I wanted to see how it works... kibana is a useful thing for me.
At first I tried newest ElasticSearch and Kibana but then realized that it is better to use versions used during original app development. New kibana is not backward compatible with old ElasticSearch thus I had to use Kibana 5.x with ElasticSearch 5.x.

Problem observed

Whenever starting ElasticSearch 5.5.2 with Kibana 5.5.2 I can see "too many redirects" on the localhost:5601 and logs showing
..."tags":["license","warning","xpack"],"pid":1,"message":"License information could not be obtained from Elasticsearch. [illegal_argument_exception] No endpoint or operation is available at [_xpack]...

followed by an error 

Unhandled rejection [illegal_argument_exception] No endpoint or operation is available at [_xpack] :: {"path":"\_xpack","statusCode":400,"response":"{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"No endpoint or operation is available at [_xpack]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"No endpoint or operation is available at [_xpack]\"},\"status\":400}"}

 Failed attempts to resolve the issue

At first I tried disabling the xpack.
And installing it in the ElasticSearch as kibana was still showing that it is missing xpack on ElasticSearch.

Then I played with some other environment variables.... this all was a bad path.

To make it more difficult I had to files:
  • docker-compose.yml with ElasticSearch service defined
  • docker-compose.overrideyml with Kibana service defined (so normally it wouldn't run)

Solution

After a while I noticed that I am using wrong image of ElasticSearch...
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.5.2
    ...
  kibana:
    image: docker.elastic.co/kibana/kibana:5.5.2
    ....

is not the same thing as

 services:
  elasticsearch:
    image: elasticsearch:5.5.2
    ...
  kibana:
    image: docker.elastic.co/kibana/kibana:5.5.2
    ....

So just change the image to proper one and write a comment that I helped you :)