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

Cannot set the elasticsearch bootstrap password in docker using environment variable. #37240

Closed
francistb opened this issue Jan 8, 2019 · 1 comment · Fixed by #37243
Closed
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Pioneer Program Team:Delivery Meta label for Delivery team

Comments

@francistb
Copy link

Elasticsearch version (bin/elasticsearch --version):
7.0.0-alpha2

Description of the problem including expected versus actual behavior:
Setting the ELASTIC_PASSWORD environment variable should allow to configure the elasticsearch bootstrap password in docker :
https://www.elastic.co/guide/en/elasticsearch/reference/master/configuring-tls-docker.html#CO19-2

Steps to reproduce:
docker run --rm -p 9200:9200 -e 'xpack.security.enabled=true' -e 'discovery.type=single-node' -e 'xpack.license.self_generated.type=trial' -e 'ELASTIC_PASSWORD=changeme' docker.elastic.co/elasticsearch/elasticsearch:7.0.0-alpha2

curl http://localhost:9200 -u elastic:changeme

Expected :
200 OK response

Actual :
401 Unauthorized

[2019-01-08T22:15:17,981][INFO ][o.e.x.s.a.AuthenticationService] [afb4f96ae58a] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]

Problem seems to be with the docker-entrypoint.sh on this line https://github.com/elastic/elasticsearch/blob/master/distribution/docker/src/docker/bin/docker-entrypoint.sh#L78 where it validates that the x-pack directory exists under bin, but it does not. Changing it for something like if [[ -f bin/x-pack-env ]]; then seems to fix the issue.

rjernst added a commit to rjernst/elasticsearch that referenced this issue Jan 8, 2019
This commit updates the file docker's entrypoint script looks for when
deciding to process the ELASTIC_PASSWORD env var. The x-pack subdir
of bin no longer exists in 7.0, where the backcompat layer for x-pack
script locations was removed.

closes elastic#37240
@rjernst rjernst added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Pioneer Program labels Jan 8, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

rjernst added a commit that referenced this issue Jan 18, 2019
This commit updates the file docker's entrypoint script looks for when
deciding to process the ELASTIC_PASSWORD env var. The x-pack subdir
of bin no longer exists in 7.0, where the backcompat layer for x-pack
script locations was removed.

closes #37240
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Pioneer Program Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants