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

Failed to expose service when an ambassador container already exists #200

Closed
laukaichung opened this issue Oct 18, 2021 · 2 comments
Closed

Comments

@laukaichung
Copy link

laukaichung commented Oct 18, 2021

I have issues exposing the elasticsearch container on a remote server.

Here are the commands:

 dokku elasticsearch:create es
 dokku elasticsearch:expose es 127.0.0.1:9200 9300

The expose command produces this error:

docker: Error response from daemon: Conflict. The container name "/dokku.elasticsearch.es.ambassador" is already in use by container "b1648f0bded938e0e8deb5410484e352271e33dd73270549495dbaa9d3dfa5dc". You have to remove (or rename) that container to be able to reuse that name.

Still I try to run this command on my local machine to access the server using an ssh tunnel:

- ssh -o ExitOnForwardFailure=yes -f -N -L 9200:127.0.0.1:9200 "root@$SERVER_IP"

But the site http://127.0.0.1:9200/ still cannot be reached. I use similar methods to expose postgres and redis and they all work. No luck with elasticsearch.

This is the result of docker container ls. It looks like elasticsearch ambassador fails to be created.

CONTAINER ID   IMAGE                     COMMAND                  CREATED             STATUS             PORTS                      NAMES
4dcad31c1895   elasticsearch:7.14.1      "/bin/tini -- /usr/l…"   15 minutes ago      Up 15 minutes      9200/tcp, 9300/tcp         dokku.elasticsearch.es
ac8e6e4cb379   dokku/ambassador:0.3.3    "/entrypoint"            49 minutes ago      Up 49 minutes      127.0.0.1:6379->6379/tcp   dokku.redis.redis.ambassador
1777ef34467a   redis:6.2.6               "docker-entrypoint.s…"   49 minutes ago      Up 49 minutes      6379/tcp                   dokku.redis.redis
5b2eb4747cb7   dokku/ambassador:0.3.3    "/entrypoint"            About an hour ago   Up About an hour   127.0.0.1:5432->5432/tcp   dokku.postgres.db.ambassador
6783c6455fc5   my-pg/pg-aws:13.421   "docker-entrypoint.s…"   About an hour ago   Up About an hour   5432/tcp                   dokku.postgres.db

dokku elasticsearch:info es:

=====> es elasticsearch service information
       Config dir:          /var/lib/dokku/services/elasticsearch/es/config
       Config options:                               
       Data dir:            /var/lib/dokku/services/elasticsearch/es/data
       Dsn:                 http://dokku-elasticsearch-es:9200
       Exposed ports:       9200->127.0.0.1:9200 9300->9300 
       Id:                  8f67773673ce09189dbc4768b2a3ca80f5142bff60ab13ef89c1ac4b92852884
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/elasticsearch/es
       Status:              running                  
       Version:             elasticsearch:7.14.1 
@josegonzalez
Copy link
Member

Try doing docker container ls -a, the container should show up there. You may try removing that container and retrying the expose.

I'll keep this ticket open since we should error better when the container exists but is stopped for whatever reason.

@laukaichung
Copy link
Author

@josegonzalez
Thank you! Doing docker container ls -a makes the culprit show up. I remove that container docker rm b1648f0bded9. Unexpose and expose elasticsearch and http://127.0.0.1:9200 is accessible now.

CONTAINER ID   IMAGE                     COMMAND                  CREATED             STATUS             PORTS                      NAMES
8f67773673ce   elasticsearch:7.14.1      "/bin/tini -- /usr/l…"   19 minutes ago      Up 19 minutes      9200/tcp, 9300/tcp         dokku.elasticsearch.es
b1648f0bded9   dokku/ambassador:0.3.3    "/entrypoint"            About an hour ago   Created                                       dokku.elasticsearch.es.ambassador
ac8e6e4cb379   dokku/ambassador:0.3.3    "/entrypoint"            About an hour ago   Up About an hour   127.0.0.1:6379->6379/tcp   dokku.redis.redis.ambassador
1777ef34467a   redis:6.2.6               "docker-entrypoint.s…"   About an hour ago   Up About an hour   6379/tcp                   dokku.redis.redis

I used dokku ansible to install dokku, and had to run the playbook multiple times because of some errors. Maybe that is the reason why that dead container exists.

@josegonzalez josegonzalez changed the title Unable to expose Elasticsearch to 127.0.0.1:9200 Failed to expose service when an ambassador container already exists Feb 7, 2023
@josegonzalez josegonzalez transferred this issue from dokku/dokku-elasticsearch Feb 7, 2023
josegonzalez pushed a commit to dokku/dokku-couchdb that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-clickhouse that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-couchdb that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-elasticsearch that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-graphite that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-mariadb that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-meilisearch that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-memcached that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-mongo that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-mysql that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-nats that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-omnisci that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-postgres that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-pushpin that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-rabbitmq that referenced this issue Feb 25, 2023
josegonzalez pushed a commit that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-rethinkdb that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-solr that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-typesense that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-clickhouse that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-couchdb that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-elasticsearch that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-graphite that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-mariadb that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-meilisearch that referenced this issue Feb 25, 2023
josegonzalez pushed a commit to dokku/dokku-mongo that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-mysql that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-nats that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-omnisci that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-postgres that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-pushpin that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-rabbitmq that referenced this issue Feb 26, 2023
josegonzalez pushed a commit that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-rethinkdb that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-solr that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-typesense that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-couchdb that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-elasticsearch that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-graphite that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-mariadb that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-meilisearch that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-memcached that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-mongo that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-mysql that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-nats that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-omnisci that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-postgres that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-pushpin that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-rabbitmq that referenced this issue Feb 26, 2023
josegonzalez pushed a commit that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-rethinkdb that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-solr that referenced this issue Feb 26, 2023
josegonzalez pushed a commit to dokku/dokku-typesense that referenced this issue Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants