Question

I have installed Docker (0.8.0-1) by running the steps described in the Resin.io blog. Basically, everything works well and I am able to start the Docker daemon as well as run the client.

Unfortunately, when I try to run a container it sometimes fails. This does not depend on the actual container, as when you repeat the command it works. Sometimes it needs more than two trials, and sometimes it also works on the first try. My run command basically looks like:

$ docker run -i -t --rm=true resin/rpi-raspbian bash

So, nothing fancy so far… the error message I get only tells me that the container exited with code 1, whatever this means.

Basically, the same happens when I try to build a Dockerfile: Usually it works for a single step and fails on the next one. As Docker internally caches the results, you can build a Dockerfile by executing it again and again manually, and on every run you get one step further. If it fails, again code 1.

The exact error message is:

2014/02/27 18:15:45 Error: start: Cannot start container 99fc6a3327fb4af25e6c7a07d992009dde8a5425de89f44aae76ce4740e09492: exit status 1

It surprises me that when I run a docker ps -a afterwards, the containers did not get removed (at least, the ones that could not be created are still there) - and, what's even more surprising, this command lists the status code as -1.

I don't see anything in the logs, when I run

$ docker logs 99fc

What might cause these issues?

UPDATE

Unfortunately, there is neither a /var/log/messages folder nor a /var/log/syslog folder on the system, but if I run dmesg the last lines are:

[56954.479079] device veth4FI4FH entered promiscuous mode
[56955.270388] docker0: port 1(veth4FI4FH) entered forwarding state
[56955.270493] docker0: port 1(veth4FI4FH) entered forwarding state
[56955.480603] docker0: port 1(veth4FI4FH) entered disabled state
[56955.484685] device veth4FI4FH left promiscuous mode
[56955.484726] docker0: port 1(veth4FI4FH) entered disabled state

UPDATE 2

I now found out that I get extended logs by calling journalctl (as I am on a systemd-based system). I get:

Feb 28 09:31:02 white docker[123]: 2014/02/28 09:31:02 POST /v1.9/containers/create
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] +job create()
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] -job create() = OK (0)
Feb 28 09:31:02 white docker[123]: 2014/02/28 09:31:02 POST /v1.9/containers/8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916/attach?stderr=1&stdin=1&stdout=1&stream=1
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] +job inspect(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916, container)
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] -job inspect(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916, container) = OK (0)
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] +job attach(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916)
Feb 28 09:31:02 white docker[123]: 2014/02/28 09:31:02 POST /v1.9/containers/8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916/start
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] +job start(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916)
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] +job allocate_interface(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916)
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] -job allocate_interface(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916) = OK (0)
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] +job allocate_port(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916)
Feb 28 09:31:02 white docker[123]: [/docker|5cd5747f] -job allocate_port(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916) = OK (0)
Feb 28 09:31:03 white docker[123]: [error] container.go:1244 Error running container: exit status 1
Feb 28 09:31:03 white docker[123]: [/docker|5cd5747f] +job release_interface(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916)
Feb 28 09:31:03 white kernel: device vethHXP55Y entered promiscuous mode
Feb 28 09:31:03 white avahi-daemon[131]: Withdrawing workstation service for vethUTI4YT.
Feb 28 09:31:03 white docker[123]: [/docker|5cd5747f] -job release_interface(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916) = OK (0)
Feb 28 09:31:03 white docker[123]: [/docker|5cd5747f] -job attach(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916) = OK (0)
Feb 28 09:31:04 white docker[123]: [/docker|5cd5747f] +job release_interface(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916)
Feb 28 09:31:04 white docker[123]: 2014/02/28 09:31:04 Unable to unmap port 0.0.0.0:80: port is not mapped
Feb 28 09:31:04 white docker[123]: [/docker|5cd5747f] -job release_interface(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916) = OK (0)
Feb 28 09:31:04 white docker[123]: [error] container.go:1299 8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916: Error closing Pty master: invalid argument
Feb 28 09:31:04 white kernel: docker0: port 1(vethHXP55Y) entered forwarding state
Feb 28 09:31:04 white kernel: docker0: port 1(vethHXP55Y) entered forwarding state
Feb 28 09:31:04 white docker[123]: Cannot start container 8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916: exit status 1[/docker|5cd5747f] -job start(8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916) = ERR (1)
Feb 28 09:31:04 white docker[123]: [error] api.go:959 Error: start: Cannot start container 8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916: exit status 1
Feb 28 09:31:04 white docker[123]: [error] api.go:91 HTTP Error: statusCode=500 start: Cannot start container 8d2928a6a4b4c57aa2760a3681a5fbcf53f890e85d6830b97b9245366d284916: exit status 1
Feb 28 09:31:04 white kernel: docker0: port 1(vethHXP55Y) entered disabled state
Feb 28 09:31:04 white avahi-daemon[131]: Withdrawing workstation service for vethHXP55Y.
Feb 28 09:31:04 white kernel: device vethHXP55Y left promiscuous mode
Feb 28 09:31:04 white kernel: docker0: port 1(vethHXP55Y) entered disabled state

So apparently the problem is in container.go:1244 while trying to start the container.

Is this of any help?

Was it helpful?

Solution

As you used our Resin port of Docker I'll assume that you're running Arch Linux. In Arch Linux the latest LXC package is lxc-1.0 and Docker has known problems with this version of LXC [1].

Downgrading LXC to 0.9 or 0.8 should fix the problem. Arch Linux keeps a cache of packages recently downloaded in /var/cache/pacman/pkg. So, as root, do pacman -U /var/cache/pacman/pkg/lxc-<VERSION> and then restart your Docker daemon.

If you don't find a cached package there you'll find more ways to do it here [2].

[1] Race condition with lxc-info #4298 (GitHub)

[2] Downgrading packages (Arch Linux wiki)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top