Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race during initial setup while updating kibana_system user #786

Closed
antoineco opened this issue Nov 16, 2022 · 0 comments
Closed

Race during initial setup while updating kibana_system user #786

antoineco opened this issue Nov 16, 2022 · 0 comments

Comments

@antoineco
Copy link
Collaborator

Problem description

Lately I've been encountering on several occasions what looks like a race during the stack's initial setup.

Right after waiting for Elasticsearch to become responsive, we initialize users by:

  • updating the password of pre-existing (built-in) users, such as kibana_system.
  • creating our own users with a corresponding role, such as logstash_internal.

Once in a full moon, the setup logic doesn't find any kibana_system user, and skips its initialization entirely, which prevents Kibana from starting.

It seems like there is a delay between the startup of the Elasticsearch API server and the moment built-in users are actually created, and we should account for it as reliably as possible (no sleep 10...).

Workaround

  1. Remove the setup volume with docker volume rm docker-elk_setup.
  2. Run docker-compose up setup again.

Extra information

Stack configuration

default

Docker setup

$ docker version

20.10.20
$ docker compose version

2.12.2

Container logs

docker-elk-setup-1  | -------- Wed Nov 16 21:06:04 UTC 2022 --------
docker-elk-setup-1  | [+] Waiting for availability of Elasticsearch. This can take several minutes.
docker-elk-setup-1  |    ⠿ Elasticsearch is running
docker-elk-setup-1  | [+] Role 'logstash_writer'
docker-elk-setup-1  |    ⠿ Creating/updating
docker-elk-setup-1  | [+] User 'kibana_system'
docker-elk-setup-1  | [x]   No role defined, skipping creation
docker-elk-setup-1  | [+] User 'logstash_internal'
docker-elk-setup-1  |    ⠿ User does not exist, creating
@antoineco antoineco added the bug label Nov 16, 2022
DanBrown47 pushed a commit to DanBrown47/docker-elk that referenced this issue Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant