Docker-compose instructions lead to "unable to authenticate user [elastic]"

More importantly it should have got rid of the volume mounts...

Do you have disk space issues?

Clean up and try this,

create a file

es-kb-no-sec-compose.yml

---
version: '3'
services:
  elasticsearch:
    container_name: es01
    image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
    # 8.x
    environment: ['CLI_JAVA_OPTS=-Xms2g -Xmx2g','bootstrap.memory_lock=true','discovery.type=single-node','xpack.security.enabled=false', 'xpack.security.enrollment.enabled=false']
    ports:
      - 9200:9200
    networks:
      - elastic
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536

  kibana:
    image: docker.elastic.co/kibana/kibana:${TAG}
    container_name: kib01
    environment:
      XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: alskdjfhlaskj-c4d3-4a0a-8290-2abcb83ab3aa
    ports:
      - 5601:5601
    networks:
      - elastic

networks:
  elastic:

$ TAG=8.7.1 docker-compose -f es-kb-no-sec-compose.yml up

This should bring up a Kibana and Elastic with no security... to just check your docker version and everything....

As per our DMs, this version works totally fine and is fit for my purposes at least, thanks again.

1 Like

hello @dadoonet !!can you give me a docker compose file for implementing passwords in elasticsearch and kibana version 8.7.1 , because with 8.7.1 version passwords are not working please can someone help me out because it's on priority

Hi @Hrithik_Hiranwar Welcome to the community!

1st please do not directly @ mention people that you are not already in a conversation with, it is not a best practice of the forum.

Have you looked at our official documentation that was linked in the very first post ! :slight_smile:

That is the official guide. See Here

And when you say not working you need to provide more information like the the original poster...

What is the Problem? What is the configuration? What are the logs etc... otherwise we can not help.

Just to triple check I just used the documentation and used the exact instruction and sample docker compose file and it worked perfectly...give it a try!

1 Like

I had the same problem on Linux. But the same config on my Mac can run successfully. I feel it's very strange and don't down how to solve it.

[2023-06-05T06:44:51.641+00:00][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. security_exception
	Root causes:
		security_exception: unable to authenticate user [kibana_system] for REST request [/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip]
[2023-06-05T06:44:52.611+00:00][INFO ][plugins.screenshotting.chromium] Browser executable: /usr/share/kibana/x-pack/plugins/screenshotting/chromium/headless_shell-linux_x64/headless_shell

I have solved this problem. I found that the password for kibana_system was not set successful.

# Password for the 'elastic' user (at least 6 characters)
ELASTIC_PASSWORD=a123456

# Password for the 'kibana_system' user (at least 6 characters)
KIBANA_PASSWORD=a123456

# Version of Elastic products
STACK_VERSION=8.8.0

# Set the cluster name
CLUSTER_NAME=docker-cluster

# Set to 'basic' or 'trial' to automatically start the 30-day trial
LICENSE=basic
#LICENSE=trial

# Port to expose Elasticsearch HTTP API to the host
ES_PORT=9200
#ES_PORT=127.0.0.1:9200

# Port to expose Kibana to the host
KIBANA_PORT=5601
#KIBANA_PORT=80

# Increase or decrease based on the available host memory (in bytes)
MEM_LIMIT=1073741824

# Project namespace (defaults to the current folder name if not set)
#COMPOSE_PROJECT_NAME=myproject

In kibana container, I execute the following command:

curl -u kibana_system:a123456 https://es01:9200/ --insecure

And the result is this:

{"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [kibana_system] for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [kibana_system] for REST request [/]","header":{"WWW-Auth

I switched to the elastic user can access successfully.

curl -u elastic:a123456 https://es01:9200/ --insecure
{
  "name" : "es01",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "khglIsTqQuSztlJopcuahQ",
  "version" : {
    "number" : "8.0.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "1b6a7ece17463df5ff54a3e1302d825889aa1161",
    "build_date" : "2022-02-03T16:47:57.507843096Z",
    "build_snapshot" : false,
    "lucene_version" : "9.0.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

So my solution was to reset kibana_system password manually.

docker exec -it docker-elk-es01-1 /bin/bash

# reset kibana_system password
elasticsearch-reset-password -u kibana_system -i

# typed your password
...

Exit container and restart kibana

docker compose restart kibana

Wait a minute, The kibana service started successfully

1 Like

Thanks a lot for sharing your detailed solution to solve this!

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