# Docker container exiting with code 0 & no logs

**URL:** <https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390>\
**Category:** Kibana\
**Created:** [November 28, 2017, 12:46pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390 "2017-11-28T12:46:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hughmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hughmp/32/24775_2.png) [@hughmp](https://discuss.elastic.co/u/hughmp)\
**Post date:** [November 28, 2017, 12:46pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/1 "2017-11-28T12:46:49Z")

</div>

I have elasticsearch up and running in a Docker container and accessible from other containers with [http://elasticsearch](http://elasticsearch). I'm trying to connect up Kibana and no matter what I try, the container simply exits with error code 0 and with no logs whatsoever (i.e. when running `docker logs [id]`)

This is the command I'm using:

```
docker run --network private \
  -e ELASTICSEARCH_URL=http://elasticsearch:9200 \
  -e XPACK_MONITORING_ENABLED=false \
  -p 5601:5601 \
  docker.elastic.co/kibana/kibana:6.0.0

```

I've tried both the `kibana` and `kibana-oss` versions. I've tried diabling x-pack, I've tried turning on verbose logging. Always with the same results.

I've also tried attaching onto /bin/bash within the container and running the kibana start command directly. Again, nothing.

Either I've missed something massively obvious or I'm going insane... I've searched in this forum, in `GitHub` issues and on Google/StackOverflow with no similar scenarios found..

Please help!

Thanks.

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [November 28, 2017, 4:51pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/2 "2017-11-28T16:51:11Z")

</div>

Is the Kibana container able to resolve "[http://elasticsearch](http://elasticsearch)"? If not, it won't be able to connect to the Elasticsearch container, and won't start up. If that's the case though, you should see a message about that in the logs, which brings me to my next question; what do you see in the Kibana logs?

---

<div class="post-metadata">

**Author:** ![hughmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hughmp/32/24775_2.png) [@hughmp](https://discuss.elastic.co/u/hughmp)\
**Post date:** [November 28, 2017, 5:13pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/3 "2017-11-28T17:13:49Z")

</div>

Hi Joe,

Thanks for your response. The main problem seems to be there are no logs! No matter what I do, nothing is printed to stdout/err in the container.

Interestingly, the plot thickens...

```
$ docker run -it --network private \
> node:6.9.1 \
> /bin/bash -c "ping elasticsearch"
PING elasticsearch (10.0.1.11): 56 data bytes
64 bytes from 10.0.1.11: icmp_seq=0 ttl=64 time=0.045 ms
64 bytes from 10.0.1.11: icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from 10.0.1.11: icmp_seq=2 ttl=64 time=0.071 ms
^C--- elasticsearch ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.045/0.064/0.079/0.000 ms

$ docker run -it --network private \
> docker.elastic.co/kibana/kibana:6.0.0 \
> /bin/bash -c "ping elasticsearch"
ping: elasticsearch: Name or service not known
```

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [November 29, 2017, 10:09am UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/4 "2017-11-29T10:09:22Z")

</div>

Sounds like you could be running out of memory. If you are not running Docker on real Linux, but Windows or macOS instead, make sure you've bumped the memory in the VM as shown in: [https://github.com/elastic/stack-docker#prerequisites](https://github.com/elastic/stack-docker#prerequisites)

When there are no logs it helps to have `docker events` running while you run your kibana container to see what's happening in the background.

---

<div class="post-metadata">

**Author:** ![hughmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hughmp/32/24775_2.png) [@hughmp](https://discuss.elastic.co/u/hughmp)\
**Post date:** [November 29, 2017, 12:48pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/5 "2017-11-29T12:48:31Z")

</div>

Thanks for your response Dimitrios. How much memory does Kibana require? I've tried it on a few different VMs, e.g.:

```
$ free -h
              total used free shared buff/cache available
Mem: 7.6G 3.3G 581M 409M 3.8G 3.4G

```

From `docker events`, I get the following:

```
2017-11-29T07:47:43.520676049-05:00 container create 9b42898a05468b58af5e2befd1a92d0993e275d22e7e07332a6297080d2bf33a (build-date=20170911, image=docker.elastic.co/kibana/kibana:6.0.0, license=GPLv2, maintainer=Elastic Docker Team <docker@elastic.co>, name=pedantic_blackwell, vendor=CentOS)
2017-11-29T07:47:43.524123293-05:00 container attach 9b42898a05468b58af5e2befd1a92d0993e275d22e7e07332a6297080d2bf33a (build-date=20170911, image=docker.elastic.co/kibana/kibana:6.0.0, license=GPLv2, maintainer=Elastic Docker Team <docker@elastic.co>, name=pedantic_blackwell, vendor=CentOS)
2017-11-29T07:47:43.963930053-05:00 network connect dirxm58uuhtosk0q6rhhzhn14 (container=9b42898a05468b58af5e2befd1a92d0993e275d22e7e07332a6297080d2bf33a, name=private, type=overlay)
2017-11-29T07:47:45.360665124-05:00 container start 9b42898a05468b58af5e2befd1a92d0993e275d22e7e07332a6297080d2bf33a (build-date=20170911, image=docker.elastic.co/kibana/kibana:6.0.0, license=GPLv2, maintainer=Elastic Docker Team <docker@elastic.co>, name=pedantic_blackwell, vendor=CentOS)
2017-11-29T07:47:45.945409716-05:00 container die 9b42898a05468b58af5e2befd1a92d0993e275d22e7e07332a6297080d2bf33a (build-date=20170911, exitCode=0, image=docker.elastic.co/kibana/kibana:6.0.0, license=GPLv2, maintainer=Elastic Docker Team <docker@elastic.co>, name=pedantic_blackwell, vendor=CentOS)
2017-11-29T07:47:46.179614882-05:00 network disconnect dirxm58uuhtosk0q6rhhzhn14 (container=9b42898a05468b58af5e2befd1a92d0993e275d22e7e07332a6297080d2bf33a, name=private, type=overlay)

```

No obvious clues 😕

Oh and I forgot to add - I'm running it on 'real' Linux:

```
$ cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.3 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.3"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.3 (Maipo)"
```

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [November 29, 2017, 1:15pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/6 "2017-11-29T13:15:33Z")

</div>

A few things to try:

1. Can you provide the `docker info` output?
2. How's your free disk space?
3. Do you think you can wipe things clean with `docker system prune -a` first?
4. To help reproduction can you use this [Vagrantfile](https://gist.github.com/dliappis/13005bc90c8487129a06e2552bcdb7da) and then:

```auto
vagrant up
vagrant ssh
docker network create private
docker run -d --name elasticsearch --network private -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:6.0.0
docker run --network private -p 5601:5601 docker.elastic.co/kibana/kibana:6.0.0

```

The procedure above works fine for me in the clean Vagrant env and will help us isolate if there's a host related issue or something else.

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [November 29, 2017, 1:19pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/7 "2017-11-29T13:19:29Z")

</div>

Also noticed the output from docker info that you pasted in the [GH issue](https://github.com/elastic/kibana-docker/issues/62#issuecomment-347852362).

Possibly not related to the issue you are reporting, but the output from docker info provides some warning that would certainly cause issues in the future:

```auto
WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
         Reformat the filesystem with ftype=1 to enable d_type support.
         Running without d_type support will not be supported in future releases.
WARNING: bridge-nf-call-ip6tables is disabled

```

---

<div class="post-metadata">

**Author:** ![hughmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hughmp/32/24775_2.png) [@hughmp](https://discuss.elastic.co/u/hughmp)\
**Post date:** [November 30, 2017, 1:51pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/8 "2017-11-30T13:51:50Z")

</div>

Thanks for clarifying, unfortunately I am constrained by my environment at the moment and am unable to use your Vagrant script. Thank you for providing it though. The warnings will be addressed in the future.

I've done a little more digging and it seems to fall down to the node installation. Using this [Dockerfile](https://gist.github.com/hughmp/79d49307f9c4e3fd9386e5dc667ce0cf) works fine. But if I switch the version of node to the same as packaged with Kibana (v6.11.5) I get exactly the same symptoms.. (quits with exit code 0)

For now I shall just use my own image as I don't have any more time to debug unfortunately.

Thank you for your help though, and maybe this will help someone else in the future..

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 28, 2017, 1:52pm UTC](https://discuss.elastic.co/t/docker-container-exiting-with-code-0-no-logs/109390/9 "2017-12-28T13:52:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
