yonetmen
By:
yonetmen

Why my docker container destroy itself?

January 31, 2017 1.8k views
Docker Java Ubuntu

This is the 3th time I am having this issue and digitalocean support is not quite helping. They are really, really slow. Anyway...

I have a 1GB droplet with 2 docker containers. One for Spring-boot 1.3.8 application and the other for MySQL 5.7. They working fine for a while... I can do all CRUD operations on my application. Well, just for a while anyway... After a couple of hours uptime, my application goes down. I go in ssh and check for containers <docker ps -a> and I see only MySQL container is there, up and running. Spring boot application is gone! What can be the problem? Why mysql container is still up and running but my application container get destroyed? What can I do to figure out what was the problem?

2 Answers

Why are you expecting DO support to help you with an application issue on your unmanaged droplet?

  • Are you here to help or what?

    I run same application on windows machine for days without problem. Unmanaged droplet? What is even that mean?

    • It means that you are responsible for managing and troubleshooting it, not DigitalOcean.

  • I am paying to them. When I open a support ticket, I expect them to answer in a reasonable time frame. Not 8 - 10 hours space between for every single answer!!

    • What made you think your $10 a month includes a SLA on support response time?

@yonetmen

To clarify on support, DigitalOcean, like many providers of VPS's or Cloud VPS's, is unmanaged, This means that if there is an issue with the network, server/hardware, their control panel, or their API, DO will provide support for issues that arise.

As far as support for software you're running on your Droplet, you're responsible for knowing how to or learning how to manage it. DigitalOcean, from what I've seen, does provide best-effort support to those who submit support tickets, though ultimately, they are under no obligation to do so as support doesn't generally extend to such cases when the service itself is unmanaged.

That said, that's why there are numerous guides available in their database and that's why there's a community where you may freely post when you're having an issue.

When you do, community members can try to help, though since we do not have physical access to your Droplet(s), we need all the information we can get upfront to help diagnose an issue, otherwise we'll have to ask for it and keep the chat going until we find the issue.

Docker Issues

As for the issues you're having with your container, have you checked the log file(s) to see if there's something causing it to fail on the host (i.e. Droplet)?

  • Hi @jtittle,

    Thank you for your clarification. Now I know what that means. As for my issue, I used this command to see some details:

    journalctl -b -u docker.service -r

    that gave me this:

    -- Logs begin at Mon 2017-01-30 08:41:44 UTC, end at Tue 2017-01-31 07:13:01 UTC. --
    Jan 30 15:32:42 spring-docker dockerd[1422]: time="2017-01-30T15:32:42.532061862Z" level=error msg="Handler for POST /v1.24/containers/create returned error: No such image: yonetmen/autocar
    Jan 30 10:11:48 spring-docker dockerd[1422]: time="2017-01-30T10:11:48.078507747Z" level=error msg="Handler for POST /v1.24/containers/create returned error: No such image: yonetmen/autocar
    Jan 30 10:08:58 spring-docker dockerd[1422]: time="2017-01-30T10:08:58.146085653Z" level=error msg="Handler for DELETE /v1.24/containers/eb8654ecb4a27211b35610cbe8510c0c75be49444f3b36622b46
    Jan 30 10:08:58 spring-docker dockerd[1422]: time="2017-01-30T10:08:58.144542245Z" level=error msg="Handler for GET /v1.24/containers/eb8654ecb4a27211b35610cbe8510c0c75be49444f3b36622b46db8
    Jan 30 09:55:28 spring-docker dockerd[1422]: time="2017-01-30T09:55:28.674579244Z" level=error msg="Handler for POST /v1.24/containers/c9d30c425f28/start returned error: No such container:
    Jan 30 09:55:22 spring-docker dockerd[1422]: time="2017-01-30T09:55:22.815113316Z" level=info msg="Container c9d30c425f28cc38474a407ba5d91b01fc12f21cd1c82213fcf78119f7354958 failed to exit
    Jan 30 09:54:58 spring-docker dockerd[1422]: time="2017-01-30T09:54:58.786240932Z" level=error msg="failed to close stdin: rpc error: code = 2 desc = containerd: process not found for conta
    Jan 30 09:52:28 spring-docker dockerd[1422]: time="2017-01-30T09:52:28.813891352Z" level=error msg="Handler for POST /v1.24/exec/e1a25740582798698111e8bf5131d5634c5a415e86d4ec28b40c0474ab1a
    Jan 30 09:52:28 spring-docker dockerd[1422]: time="2017-01-30T09:52:28.797241586Z" level=error msg="Error running exec in container: rpc error: code = 13 desc = invalid header field value \
    Jan 30 09:32:50 spring-docker dockerd[1422]: time="2017-01-30T09:32:50.775311383Z" level=info msg="Container 75189d40c64da9273b2b0a2010454b35fc13126fa3799948ece38dbfdfe82f0f failed to exit
    Jan 30 09:32:28 spring-docker dockerd[1422]: time="2017-01-30T09:32:28.136607373Z" level=error msg="failed to close stdin: rpc error: code = 2 desc = containerd: process not found for conta
    Jan 30 09:28:32 spring-docker dockerd[1422]: time="2017-01-30T09:28:32.638057102Z" level=error msg="failed to close stdin: rpc error: code = 2 desc = containerd: process not found for conta
    Jan 30 09:28:05 spring-docker dockerd[1422]: time="2017-01-30T09:28:05.163916279Z" level=error msg="failed to close stdin: rpc error: code = 2 desc = containerd: process not found for conta
    Jan 30 09:11:13 spring-docker dockerd[1422]: time="2017-01-30T09:11:13.083334119Z" level=error msg="Handler for POST /v1.24/containers/create returned error: No such image: yonetmen/autocar
    Jan 30 09:09:53 spring-docker dockerd[1422]: time="2017-01-30T09:09:53.281938680Z" level=error msg="Handler for POST /v1.24/containers/create returned error: No such image: mysql:5.7"
    Jan 30 09:09:34 spring-docker dockerd[1422]: time="2017-01-30T09:09:34.039764524Z" level=error msg="Handler for DELETE /v1.24/images/7666f75adb6b returned error: No such image: 7666f75adb6b
    Jan 30 08:48:34 spring-docker dockerd[1422]: time="2017-01-30T08:48:34.391757493Z" level=error msg="Handler for POST /v1.24/containers/create returned error: No such image: yonetmen/autocar
    Jan 30 08:45:28 spring-docker dockerd[1422]: time="2017-01-30T08:45:28.004939412Z" level=error msg="Handler for POST /v1.24/containers/create returned error: No such image: mysql:5.7"
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.875125893Z" level=info msg="API listen on /var/run/docker.sock"
    Jan 30 08:41:51 spring-docker systemd[1]: Started Docker Application Container Engine.
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.821129839Z" level=info msg="Docker daemon" commit=78d1802 graphdriver=aufs version=1.12.6
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.820904320Z" level=info msg="Daemon has completed initialization"
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.820425471Z" level=info msg="Loading containers: done."
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.726943309Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.528518258Z" level=info msg="Firewalld running: false"
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.445968017Z" level=info msg="Loading containers: start."
    Jan 30 08:41:51 spring-docker dockerd[1422]: time="2017-01-30T08:41:51.444901782Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
    Jan 30 08:41:49 spring-docker systemd[1]: Starting Docker Application Container Engine...
    Jan 30 08:41:50 spring-docker dockerd[1422]: time="2017-01-30T08:41:50.240469729Z" level=info msg="libcontainerd: new containerd process, pid: 1550"
    lines 1-30/30 (END)

    Is there any other log files that I can check?

    • @yonetmen

      First, I'd recommend checking to see if you can upgrade to the latest release of Docker to make sure you're up to date. Normally I recommend running a full upgrade of all packages, which can be done using:

      sudo apt-get -y upgrade
      

      The above command will automatically upgrade any packages that are currently out of date.

      With everything updated, I would look in to the image your running. If your MySQL container isn't failing, but Spring Boot is, there may be an issue with the image.

      You can mount a local directory to your container by passing the -v argument, which would allow you to mount a local directory to /var/log on the container and see what's logged in the container itself and perhaps gather more intel that way.

      For example:

      -v /path/on/droplet:/var/log
      

      You can create /path/on/droplet anywhere on the Droplet, for example:

      mkdir -p /opt/docker/container_name/log
      

      Then pass -v:

      -v /opt/docker/container_name/log:/var/log
      

      Where /opt/docker/container_name/log is the directory on the Droplet and /var/log is the directory inside the container.

      And then you would be able to browse over to the directory you just created and view the logs that are being created by the container.

Have another answer? Share your knowledge.