Closed ajbeach2 closed 3 months ago
issue seems to be password, i tried a different password and it seems to work. Escaping issue maybe?
I have the same problem when I've tried to start opensearch via "docker compose" and via CLI works well.
export OPENSEARCH_INITIAL_ADMIN_PASSWORD=hdgsdhdHGa12bas
docker compose up
No custom admin password found. Please provide a password via the environment variable OPENSEARCH_INITIAL_ADMIN_PASSWORD.
opensearch:
image: opensearchproject/opensearch:latest
container_name: opensearch
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch
- discovery.seed_hosts=opensearch
- cluster.initial_cluster_manager_nodes=opensearch
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=hdgsdhdHGa12bas
[opensearch] Authentication finally failed for admin from XXXXX:56792
docker run --rm -it -p 9200:9200 -p 9600:9600 -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="hdgsdhdHGa12bas" -e "discovery.type=single-node" --name opensearch-node opensearchproject/opensearch:latest
This is because $w tries to resolve a variable called w
.
$ echo "$w#ubWY7q*62@%"
#ubWY7q*62@%
Single quotes would work.
$ echo '$w#ubWY7q*62@%'
$w#ubWY7q*62@%
We may want to update docs to say something to this effect. Please feel free to PR!
Describe the bug
I am starting docker container with the following (which is directly from docs) https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/
Running curl:
Related component
Other
To Reproduce
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD=$w#ubWY7q*62@%" opensearchproject/opensearch:2.12.0
then
curl -v https://localhost:9200 -ku 'admin:$w#ubWY7q*62@%'
which returns 401
Expected behavior
docs work as described.
Additional Details
No response