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

Docker run command error #4666

Closed
teckays opened this Issue Mar 14, 2014 · 14 comments

Comments

Projects
None yet
4 participants
@teckays

teckays commented Mar 14, 2014

I have just installed docker on my machine following the docker documentation as is and I cannot run any commands inside an image container, an error is thrown:

root@server:~# docker run ubuntu ls
2014/03/14 12:42:46 Error: Cannot start container 71ef5af3af7fe9ff0191084dbc217c79f8ff7933c1fa8d11251466743c53d075: fork/exec /var/lib/docker/containers/71ef5af3af7fe9ff0191084dbc217c79f8ff7933c1fa8d11251466743c53d075/root/.dockerinit: invalid argument

The same error is thrown on all comands I run:
sudo docker run -i -t ubuntu /bin/bash
or
sudo docker run busybox echo hello!

Here's my
docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu              13.10               9f676bd305a4        5 weeks ago         182.1 MB
ubuntu              saucy               9f676bd305a4        5 weeks ago         182.1 MB
ubuntu              raring              eb601b8965b8        5 weeks ago         170.2 MB
ubuntu              13.04               eb601b8965b8        5 weeks ago         170.2 MB
ubuntu              12.10               5ac751e8d623        5 weeks ago         161.4 MB
ubuntu              quantal             5ac751e8d623        5 weeks ago         161.4 MB
ubuntu              10.04               9cc9ea5ea540        5 weeks ago         183 MB
ubuntu              lucid               9cc9ea5ea540        5 weeks ago         183 MB
ubuntu              12.04               9cd978db300e        5 weeks ago         204.7 MB
ubuntu              latest              9cd978db300e        5 weeks ago         204.7 MB
ubuntu              precise             9cd978db300e        5 weeks ago         204.7 MB
busybox             latest              769b9341d937        5 weeks ago         2.489 MB

does anyone have a solution for this?

@enokd

This comment has been minimized.

Show comment
Hide comment
@enokd

enokd Mar 14, 2014

Contributor

@stalbe adding the results of the following commands would help :
docker version
uname -a

Contributor

enokd commented Mar 14, 2014

@stalbe adding the results of the following commands would help :
docker version
uname -a

@teckays

This comment has been minimized.

Show comment
Hide comment
@teckays

teckays Mar 14, 2014

docker version: 0.9.0
uname -a: Linux vps--- 3.8.13-xxxx-grs-ipv6-64-vps #2 SMP Fri May 17 05:56:23 CEST 2013 x86_64 x86_64 x86_64 GNU/Linux

teckays commented Mar 14, 2014

docker version: 0.9.0
uname -a: Linux vps--- 3.8.13-xxxx-grs-ipv6-64-vps #2 SMP Fri May 17 05:56:23 CEST 2013 x86_64 x86_64 x86_64 GNU/Linux

@unclejack

This comment has been minimized.

Show comment
Hide comment
@unclejack

unclejack Mar 14, 2014

Contributor

@stalbe Please post the full output of docker info and docker version.

Contributor

unclejack commented Mar 14, 2014

@stalbe Please post the full output of docker info and docker version.

@teckays

This comment has been minimized.

Show comment
Hide comment
@teckays

teckays Mar 14, 2014

docker info
Containers: 23
Images: 7
Driver: devicemapper
 Pool Name: docker-8:1-1016297-pool
 Data file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
 Data Space Used: 733.1 Mb
 Data Space Total: 102400.0 Mb
 Metadata Space Used: 2.0 Mb
 Metadata Space Total: 2048.0 Mb
docker version
Client version: 0.9.0
Go version (client): go1.2.1
Git commit (client): 2b3fdf2
Server version: 0.9.0
Git commit (server): 2b3fdf2
Go version (server): go1.2.1
Last stable version: 0.9.0

teckays commented Mar 14, 2014

docker info
Containers: 23
Images: 7
Driver: devicemapper
 Pool Name: docker-8:1-1016297-pool
 Data file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
 Data Space Used: 733.1 Mb
 Data Space Total: 102400.0 Mb
 Metadata Space Used: 2.0 Mb
 Metadata Space Total: 2048.0 Mb
docker version
Client version: 0.9.0
Go version (client): go1.2.1
Git commit (client): 2b3fdf2
Server version: 0.9.0
Git commit (server): 2b3fdf2
Go version (server): go1.2.1
Last stable version: 0.9.0
@enokd

This comment has been minimized.

Show comment
Hide comment
@enokd

enokd Mar 14, 2014

Contributor

@stalbe could you please run docker in debug mode:
sudo service docker stop
sudo docker -d
and see what happens when running :
sudo docker run -i -t ubuntu /bin/bash

Contributor

enokd commented Mar 14, 2014

@stalbe could you please run docker in debug mode:
sudo service docker stop
sudo docker -d
and see what happens when running :
sudo docker run -i -t ubuntu /bin/bash

@teckays

This comment has been minimized.

Show comment
Hide comment
@teckays

teckays Mar 14, 2014

@enokd I came across this issue about the OVH modified Kernel and it might be the problem causing the above error. I will try to install it on a clean kernel and see if the error happens.

teckays commented Mar 14, 2014

@enokd I came across this issue about the OVH modified Kernel and it might be the problem causing the above error. I will try to install it on a clean kernel and see if the error happens.

@teckays

This comment has been minimized.

Show comment
Hide comment
@teckays

teckays Mar 14, 2014

@enokd OK, installed from the tutorial on a fresh new server with clean kernel and ran a command in the default ubuntu container wi no debug mode enabled.

When running in debug mode as you sugested:

sudo docker -d
[/var/lib/docker|f1cde2bd] +job serveapi(unix:///var/run/docker.sock)
[/var/lib/docker|f1cde2bd] +job initserver()
[/var/lib/docker|f1cde2bd.initserver()] Creating server
2014/03/14 18:56:32 Listening for HTTP on unix (/var/run/docker.sock)
[/var/lib/docker|f1cde2bd] +job init_networkdriver()
[/var/lib/docker|f1cde2bd] -job init_networkdriver() = OK (0)
Loading containers: ......................: done.
[/var/lib/docker|f1cde2bd.initserver()] Creating pidfile
[/var/lib/docker|f1cde2bd.initserver()] Setting up signal traps
[/var/lib/docker|f1cde2bd] -job initserver() = OK (0)
[/var/lib/docker|f1cde2bd] +job acceptconnections()
[/var/lib/docker|f1cde2bd] -job acceptconnections() = OK (0)

looks like it hanged up, no possibility to run sudo docker run -i -t ubuntu /bin/bash

teckays commented Mar 14, 2014

@enokd OK, installed from the tutorial on a fresh new server with clean kernel and ran a command in the default ubuntu container wi no debug mode enabled.

When running in debug mode as you sugested:

sudo docker -d
[/var/lib/docker|f1cde2bd] +job serveapi(unix:///var/run/docker.sock)
[/var/lib/docker|f1cde2bd] +job initserver()
[/var/lib/docker|f1cde2bd.initserver()] Creating server
2014/03/14 18:56:32 Listening for HTTP on unix (/var/run/docker.sock)
[/var/lib/docker|f1cde2bd] +job init_networkdriver()
[/var/lib/docker|f1cde2bd] -job init_networkdriver() = OK (0)
Loading containers: ......................: done.
[/var/lib/docker|f1cde2bd.initserver()] Creating pidfile
[/var/lib/docker|f1cde2bd.initserver()] Setting up signal traps
[/var/lib/docker|f1cde2bd] -job initserver() = OK (0)
[/var/lib/docker|f1cde2bd] +job acceptconnections()
[/var/lib/docker|f1cde2bd] -job acceptconnections() = OK (0)

looks like it hanged up, no possibility to run sudo docker run -i -t ubuntu /bin/bash

@vieux

This comment has been minimized.

Show comment
Hide comment
@vieux

vieux Mar 14, 2014

Collaborator

sudo docker -d runs the daemon in forground mode. It is supposed to hang

You need to do your docker run in another term

Collaborator

vieux commented Mar 14, 2014

sudo docker -d runs the daemon in forground mode. It is supposed to hang

You need to do your docker run in another term

@vieux

This comment has been minimized.

Show comment
Hide comment
@vieux

vieux Mar 14, 2014

Collaborator

and -d is not debug. debug is -D

Collaborator

vieux commented Mar 14, 2014

and -d is not debug. debug is -D

@teckays

This comment has been minimized.

Show comment
Hide comment
@teckays

teckays Mar 14, 2014

@vieux can't run sudo docker -D does not recognize the argument, only sudo docker -d works.

here's the output:

2014/03/14 19:13:48 POST /v1.10/containers/create
[/var/lib/docker|b697a993] +job create()
Local (127.0.0.1) DNS resolver found in resolv.conf and containers can't use it. Using default external servers : [8.8.8.8 8.8.4.4]
[/var/lib/docker|b697a993] -job create() = OK (0)
2014/03/14 19:13:48 POST /v1.10/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/attach?stderr=1&stdin=1&stdout=1&stream=1
[/var/lib/docker|b697a993] +job inspect(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc, container)
[/var/lib/docker|b697a993] -job inspect(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc, container) = OK (0)
[/var/lib/docker|b697a993] +job attach(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
2014/03/14 19:13:48 POST /v1.10/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/start
[/var/lib/docker|b697a993] +job start(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] +job allocate_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] -job allocate_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[error] container.go:784 Error running container: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument
[/var/lib/docker|b697a993] +job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] -job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[error] container.go:841 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: Error closing terminal: invalid argument
[/var/lib/docker|b697a993] +job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] -job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[error] container.go:841 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: Error closing terminal: invalid argument
[error] driver.go:121 Warning: error unmounting device 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: UnmountDevice: device not-mounted id 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc
Cannot start container 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument
[/var/lib/docker|b697a993] -job attach(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[/var/lib/docker|b697a993] -job start(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = ERR (1)
[error] server.go:951 Error: Cannot start container 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument
[error] server.go:86 HTTP Error: statusCode=500 Cannot start container 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument

teckays commented Mar 14, 2014

@vieux can't run sudo docker -D does not recognize the argument, only sudo docker -d works.

here's the output:

2014/03/14 19:13:48 POST /v1.10/containers/create
[/var/lib/docker|b697a993] +job create()
Local (127.0.0.1) DNS resolver found in resolv.conf and containers can't use it. Using default external servers : [8.8.8.8 8.8.4.4]
[/var/lib/docker|b697a993] -job create() = OK (0)
2014/03/14 19:13:48 POST /v1.10/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/attach?stderr=1&stdin=1&stdout=1&stream=1
[/var/lib/docker|b697a993] +job inspect(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc, container)
[/var/lib/docker|b697a993] -job inspect(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc, container) = OK (0)
[/var/lib/docker|b697a993] +job attach(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
2014/03/14 19:13:48 POST /v1.10/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/start
[/var/lib/docker|b697a993] +job start(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] +job allocate_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] -job allocate_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[error] container.go:784 Error running container: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument
[/var/lib/docker|b697a993] +job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] -job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[error] container.go:841 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: Error closing terminal: invalid argument
[/var/lib/docker|b697a993] +job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc)
[/var/lib/docker|b697a993] -job release_interface(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[error] container.go:841 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: Error closing terminal: invalid argument
[error] driver.go:121 Warning: error unmounting device 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: UnmountDevice: device not-mounted id 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc
Cannot start container 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument
[/var/lib/docker|b697a993] -job attach(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = OK (0)
[/var/lib/docker|b697a993] -job start(0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc) = ERR (1)
[error] server.go:951 Error: Cannot start container 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument
[error] server.go:86 HTTP Error: statusCode=500 Cannot start container 0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc: fork/exec /var/lib/docker/containers/0b55cc2715ee9ceb2be7b1e6c764b7b02db57200be857df252b7acc382aa66dc/root/.dockerinit: invalid argument
@vieux

This comment has been minimized.

Show comment
Hide comment
@vieux

vieux Mar 14, 2014

Collaborator

docker -D -d ?

Collaborator

vieux commented Mar 14, 2014

docker -D -d ?

@teckays

This comment has been minimized.

Show comment
Hide comment
@teckays

teckays Mar 14, 2014

@vieux $ docker -D -d output: (I will select [errors] only as the output is very long)

[error] container.go:784 Error running container: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument
[error] container.go:841 abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: Error closing terminal: invalid argument
[error] container.go:841 abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: Error closing terminal: invalid argument
[error] driver.go:121 Warning: error unmounting device abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: UnmountDevice: device not-mounted id abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd
Cannot start container abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument
[/var/lib/docker|7d599489] -job start(abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd) = ERR (1)
[error] server.go:951 Error: Cannot start container abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument
[error] server.go:86 HTTP Error: statusCode=500 Cannot start container abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument

teckays commented Mar 14, 2014

@vieux $ docker -D -d output: (I will select [errors] only as the output is very long)

[error] container.go:784 Error running container: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument
[error] container.go:841 abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: Error closing terminal: invalid argument
[error] container.go:841 abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: Error closing terminal: invalid argument
[error] driver.go:121 Warning: error unmounting device abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: UnmountDevice: device not-mounted id abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd
Cannot start container abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument
[/var/lib/docker|7d599489] -job start(abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd) = ERR (1)
[error] server.go:951 Error: Cannot start container abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument
[error] server.go:86 HTTP Error: statusCode=500 Cannot start container abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd: fork/exec /var/lib/docker/containers/abd910b544f99c8e549fae26c6d53feac23d8ec54153795bc1f2412e215b41dd/root/.dockerinit: invalid argument
@teckays

This comment has been minimized.

Show comment
Hide comment
@teckays

teckays Mar 14, 2014

Solved! Looks like installing Ubuntu on an OVH server with clean Kernel does actually isntall their own kernel. Here's the solution to install the clean one:

apt-get install linux-image-server
mv /etc/grub.d/06_OVHkernel /etc/grub.d/25_OVHkernel
update-grub
shutdown -r now

teckays commented Mar 14, 2014

Solved! Looks like installing Ubuntu on an OVH server with clean Kernel does actually isntall their own kernel. Here's the solution to install the clean one:

apt-get install linux-image-server
mv /etc/grub.d/06_OVHkernel /etc/grub.d/25_OVHkernel
update-grub
shutdown -r now
@unclejack

This comment has been minimized.

Show comment
Hide comment
@unclejack

unclejack Mar 15, 2014

Contributor

@stalbe It's good to hear you've fixed it.

I'll close this issue now. Please feel free to comment.

Contributor

unclejack commented Mar 15, 2014

@stalbe It's good to hear you've fixed it.

I'll close this issue now. Please feel free to comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment