dokku / dokku-elasticsearch

an elasticsearch plugin for dokku
MIT License
92 stars 35 forks source link

I'm getting this Error, while creating a container with ELS v2.3.5 #44

Closed ghost closed 7 years ago

ghost commented 7 years ago

dokku elasticsearch:create store =====> Copying config files into place Container command retried 10 time(s): cp -arfp --no-clobber /etc/elasticsearch/. /usr/share/elasticsearch/config/ Failed to run command: cp -arfp --no-clobber /etc/elasticsearch/. /usr/share/elasticsearch/config/

josegonzalez commented 7 years ago

Destroy that elasticsearch service and try recreating it. There is a bug in docker where sometimes it won't respond correctly to commands run against a container.

ghost commented 7 years ago

Hi @josegonzalez I did try it to destroy and recreate elasticsearch service, also I did uninstall and reinstall the plugin, reboot , add more swap memory but the problem still persist when I run: -$ dokku elasticsearch:create test.

I think it is something relate to ELS version 2.3.5, on olders version I didn't had this problem, Is there anyway to manual install an older version?

josegonzalez commented 7 years ago

No, its not related to the elasticsearch version. I know because I wrote the code that configures elasticsearch to work properly. Docker has a bug where sometimes it fails to get the proper exit code from a command it runs against an existing docker container. If you commit a change to create a new image, that is fine, it's just running a command against an actual container that tends to barf.

https://github.com/dokku/dokku-elasticsearch/commit/84a2e03fdd36042670289004ff30dc6d55d45566

Note: this wouldnt be necessary at all if the default for ES 2.x was to listen to all interfaces. I realize it's a security fix, but it necessitates all sorts of bullshit to make it work as desired.

josegonzalez commented 7 years ago

Does it always fail on that same command?

josegonzalez commented 7 years ago

Let me think on this, it's definitely annoying that we even have to do these sorts of tricks to get docker to host elasticsearch properly, so maybe there is something we can do to fix the upstream Docker image as well (we're using the official one).

urlsangel commented 7 years ago

Hi Jose

I'm having exactly the same problem as described above - I've destroyed and recreated a number of times, but am still getting the following error:

dokku elasticsearch:create staging
=====> Copying config files into place
Container command retried 10 time(s): cp -arfp --no-clobber /etc/elasticsearch/. /usr/share/elasticsearch/config/
Failed to run command: cp -arfp --no-clobber /etc/elasticsearch/. /usr/share/elasticsearch/config/

Any ideas on how to resolve this?

Thanks,

Russell.

ffullenk commented 7 years ago

trying with 2.3.5 and 2.2.2 : ubuntu@ip-172-30-1-103:$ export ELASTICSEARCH_IMAGE_VERSION="2.2.2" ubuntu@ip-172-30-1-103:$ dokku elasticsearch:create kibana 2.2.2: Pulling from library/elasticsearch 386a066cd84a: Already exists 75ea84187083: Already exists 3e2e387eb26a: Already exists eef540699244: Already exists 1624a2f8d114: Already exists 7018f4ec6e0a: Already exists 6ca3bc2ad3b3: Already exists 424638b495a6: Already exists 2ff72d0b7bea: Already exists 9d25542ccc02: Already exists 3e18ad7cd1d0: Pull complete e3dd62a5b99c: Pull complete 3731a9e71e1f: Pull complete 53eabcef7f8e: Pull complete Digest: sha256:987eeb57e73ecf1513582c7117ad3a4dc1727ba7a4e141c3db7fca8a5339a9c6 Status: Downloaded newer image for elasticsearch:2.2.2 Waiting for container to be ready ERROR: unable to connect

then...

ubuntu@ip-172-30-1-103:$ dokku elasticsearch:restart kibana ! Service is already stopped -----> Starting container docker: Error response from daemon: Conflict. The name "/dokku.elasticsearch.kibana" is already in use by container 29dc63cfa082a11217de9a84fba7916609015a643e862422b1d4dba86d70fb03. You have to remove (or rename) that container to be able to reuse that name.. See 'docker run --help'. ubuntu@ip-172-30-1-103:$ dokku elasticsearch:stop kibana ! Service is already stopped ubuntu@ip-172-30-1-103:$ dokku elasticsearch:start kibana -----> Starting container docker: Error response from daemon: Conflict. The name "/dokku.elasticsearch.kibana" is already in use by container 29dc63cfa082a11217de9a84fba7916609015a643e862422b1d4dba86d70fb03. You have to remove (or rename) that container to be able to reuse that name.. See 'docker run --help'.

josegonzalez commented 7 years ago

@ffullenk that has nothing to do with this issue, can you file a new one?