Skip to content
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

v0.9.0 Error getting size: bad file descriptor #4568

Closed
parente opened this issue Mar 11, 2014 · 44 comments
Closed

v0.9.0 Error getting size: bad file descriptor #4568

parente opened this issue Mar 11, 2014 · 44 comments

Comments

@parente
Copy link

parente commented Mar 11, 2014

Trying to run bash in a base Ubuntu container on a fresh Ubuntu 13.10 host box with Docker 0.9.0:

root@machine:~# docker run -t -i ubuntu /bin/bash
[error] client.go:2315 Error getting size: bad file descriptor

root@machine:~# 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

root@machine:~# docker info
Containers: 18
Images: 11
Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 47
WARNING: No swap limit support

root@machine:~# lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 13.10
Release:    13.10
Codename:   saucy

Tried install cgroup-lite (per suggestion in irc) without success.

@crosbymichael
Copy link
Contributor

Can you try running without -t to see if there are other errors?

@tianon
Copy link
Member

tianon commented Mar 11, 2014

Did you reboot after installing cgroup-lite?

@lightsofapollo
Copy link
Contributor

I had this same problem... it was solved by doing this:

sudo apt-get install cgroup-lite
sudo reboot

(On my vagrant vm)

@parente
Copy link
Author

parente commented Mar 11, 2014

@crosbymichael fails silently with "exit -1" without the -t it seems

root@machine:~# docker ps -l
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
6c4071df5531        ubuntu:12.04        /bin/bash           2 seconds ago       Exit -1                                 dreamy_franklin

@tianon, @lightsofapollo yes, installed and rebooted the box to no avail

root@machine:~# dpkg --get-selections | grep cgroup
cgroup-lite                 install

@crosbymichael
Copy link
Contributor

can you show us the output of mount on your host?

@parente
Copy link
Author

parente commented Mar 11, 2014

@crosbymichael mount below. I also started Docker daemon in debug mode, ran without -t, and noted this in log:

[error] container.go:784 Error running container: mkdir /sys/fs/devices: no such file or directory
root@machine:/sys# mount
/dev/mapper/etc159--vg-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
cgroup on /sys/fs/cgroup type cgroup (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /sys/firmware/efi/efivars type efivarfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/sda2 on /boot type ext2 (rw)
/dev/sda1 on /boot/efi type vfat (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)

@parente
Copy link
Author

parente commented Mar 11, 2014

FWIW, there's a /sys/devices but no /sys/fs/devices. Is this is a simple path typo?

@tianon
Copy link
Member

tianon commented Mar 11, 2014

Can you paste for us your "/etc/fstab" now? It looks like you're using systemd, but for some reason you don't have the proper hierarchy mounts that it's supposed to set up for you.

@lazaruslarue
Copy link

Having very similar issues on a fresh installation of Ubuntu 13.10 after installing docker && sudo reboot:

ubuntu@neodock:~$ sudo docker run -i -t ubuntu /bin/bash
[error] client.go:2315 Error resize: Error: bad file descriptor
ubuntu@neodock:~$ sudo docker run -i  ubuntu /bin/bash
ubuntu@neodock:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
ubuntu@neodock:~$ sudo 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
ubuntu@neodock:~$ sudo docker info
Containers: 3
Images: 11
Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 17
WARNING: No memory limit support
WARNING: No swap limit support
ubuntu@neodock:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 13.10
Release:    13.10
Codename:   saucy
ubuntu@neodock:~$
ubuntu@neodock:~$ cat /etc/fstab
UUID=aeeaa387-3edd-477e-a85d-fa7f738c3208   /    ext4   defaults,discard    0 0
/dev/sdb1   /mnt    auto    defaults,nobootwait,comment=cloudconfig 0   2

@lazaruslarue
Copy link

output of mount, per IRC:

ubuntu@neodock:~$ mount
/dev/sda1 on / type ext4 (rw,discard)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/sdb1 on /mnt type ext4 (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)

@tianon
Copy link
Member

tianon commented Mar 11, 2014

Anyone/everyone running into this on Ubuntu should test out:

sudo wget -O /etc/init/docker.conf https://raw.github.com/dotcloud/docker/master/contrib/init/upstart/docker.conf
sudo service docker restart

and comment on #4574 if it fixes the problem for you.

If you're on Debian, you should instead use something like:

sudo wget -O /etc/init.d/docker https://raw.github.com/dotcloud/docker/master/contrib/init/sysvinit-debian/docker
sudo chmod +x /etc/init.d/docker
sudo service docker restart

@parente
Copy link
Author

parente commented Mar 11, 2014

@tianon slightly different error after using your new init script

root@machine:/home/administrator# docker run -t -i ubuntu /bin/bash
[error] client.go:2298 Error getting size: bad file descriptor

Checking /sys/fs/cgroup after restart docker and I see it's empty.

@mbonano
Copy link

mbonano commented Mar 11, 2014

I am experiencing the same error as @parente:

[error] client.go:2298 Error getting size: bad file descriptor

@parente
Copy link
Author

parente commented Mar 11, 2014

@tianon Got your script working by:

  1. Uninstalling / purging cgroup-lite.
  2. Uninstalling / purging docker.
  3. Rebooting.
  4. Reinstalling docker 0.9. (Without cgroup-lite)
  5. Replacing the upstart script with yours.

I think something in the above had mucked with my /etc/fstab because my mounts had included the following before this purge:

cgroup on /sys/fs/cgroup type cgroup (rw)

which probably what caused your new script to abort early before creating the subdirs.

@mbonano
Copy link

mbonano commented Mar 11, 2014

+1 @parente. After a complete removal and fresh installation of docker and cgroup-lite, I am no longer experiencing the issue.

jwvdiermen pushed a commit to jwvdiermen/docker-postgresql that referenced this issue Mar 11, 2014
Error had nothing to do with the code itself, but a bug in Docker 0.9.
See moby/moby#4568 for more information.
@fernandosanchezjr
Copy link

@parente I had the same issue with a cgroups entry on my fstab as well. After commenting that entry, the directions on #4574 worked for me on Ubuntu 13.10.

@jwvdiermen
Copy link

@tianon I had this issue and your fix worked. Thanks a lot!

@timthelion
Copy link
Contributor

I replied to this issue #2683 when I'm actually suffering from the one here.

@timthelion
Copy link
Contributor

I'm actually not sure what I'm suffering from :/ . Earlier I was getting exactly the same error as listed here, now I'm getting:

timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
[error] client.go:2298 Error getting size: bad file descriptor
timothy@timothy:~$

Note how the line number is different...

Anyways, running the deamon with the lxc driver:

# docker -d -e lxc

Results in a functioning docker:

timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
[error] client.go:2298 Error getting size: bad file descriptor
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
timothy@timothy:~$ docker run -i -t busybox /bin/echo hi
hi
[error] client.go:2298 Error getting size: bad file descriptor
timothy@timothy:~$ 

But as you see, I STILL get that same error every now and then. Just not always.

@timthelion
Copy link
Contributor

I tried @tianon 's script, but it didn't seem to help.

/etc/fstab:

timothy@timothy:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=4646bd33-8cef-4a6c-94a1-fc095d1babe2 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=db83f612-8b64-458e-ab07-13b77b8cde82 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sdb1       /media/usb0     auto    rw,user,noauto  0       0
/dev/sdb2       /media/usb1     auto    rw,user,noauto  0       0
#none /sys/fs/cgroup cgroup defaults 0 0
cgroup /sys/fs/cgroup cgroup defaults 0 0

/proc/mounts

timothy@timothy:~$ cat /proc/mounts 
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=1013506,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=812364k,mode=755 0 0
/dev/disk/by-uuid/4646bd33-8cef-4a6c-94a1-fc095d1babe2 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=4975640k 0 0
cgroup /sys/fs/cgroup cgroup rw,relatime,perf_event,blkio,net_cls,freezer,devices,cpuacct,cpu,cpuset,clone_children 0 0
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0

I'm on Debian wheezy here with a modern kernel. :

timothy@timothy:~$ uname -a
Linux timothy 3.12-0.bpo.1-amd64 #1 SMP Debian 3.12.9-1~bpo70+1 (2014-02-07) x86_64 GNU/Linux
timothy@timothy:~$ 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

@markijbema
Copy link

On ubuntu 13.10, the installing of cgroup-lite fixed it.

@tianon
Copy link
Member

tianon commented Mar 13, 2014

@timthelion you need to comment out the cgroup line in your /etc/fstab and reboot

@timthelion
Copy link
Contributor

@tianon thanks alot :) Just got busybox to echo hi without errors using your script on debian wheezy!

@anthonator
Copy link

Same as @markijbema. Issue was fixed after install cgroup-lite on Ubuntu 13.10.

@uknownothingsnow
Copy link

thanks to @lightsofapollo ,
sudo apt-get install cgroup-lite
sudo reboot
solve my problem

@ekristen
Copy link
Contributor

+1 to installing cgroup-lite

Is this just a temporary work around or something that will have to be done on Ubuntu 13.10?

@nathanleclaire
Copy link
Contributor

I can confirm that @lightsofapollo 's solution worked for me.

sudo apt-get install cgroup-lite
sudo reboot

I had installed Docker on Cygwin running a Vagrant image (Ubuntu 13.04 Raring Ringtail box from http://goo.gl/Y4aRr) following the intructions here and was getting the aforementioned error message:

[error] client.go:2298 Error getting size: bad file descriptor

@mfournier
Copy link

FWIW, on debian jessie/sid, installing cgroupfs-mount, which seems to be a rough equivalent to cgroup-lite on ubuntu, and the rebooting, seems to solve the issue.

@inthecloud247
Copy link

verified that on aws ubuntu-13.04, didn't work until I did:
sudo apt-get install cgroup-lite

@anandkumarpatel
Copy link
Contributor

ran into same issue on fresh ubuntu saucy on ec2. installed git first then docker and ran into this.
here are debug logs when trying to run sudo docker run -i -t ubuntu /bin/bash

[debug] server.go:925 Calling POST /containers/create
2014/03/22 01:56:11 POST /v1.10/containers/create
[/var/lib/docker|ab32b05b] +job create()
[/var/lib/docker|ab32b05b] -job create() = OK (0)
[debug] server.go:925 Calling POST /containers/{name:.*}/attach
2014/03/22 01:56:11 POST /v1.10/containers/ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152/attach?stderr=1&stdin=1&stdout=1&stream=1
[/var/lib/docker|ab32b05b] +job inspect(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152, container)
[/var/lib/docker|ab32b05b] -job inspect(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152, container) = OK (0)
[/var/lib/docker|ab32b05b] +job attach(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152)
[debug] container.go:227 attach: stdin: begin
[debug] container.go:264 attach: stdout: begin
[debug] container.go:302 attach: stderr: begin
[debug] container.go:348 attach: waiting for job 1/3
[debug] server.go:925 Calling POST /containers/{name:.*}/start
2014/03/22 01:56:11 POST /v1.10/containers/ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152/start
[/var/lib/docker|ab32b05b] +job start(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152)
[/var/lib/docker|ab32b05b] +job allocate_interface(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152)
[/var/lib/docker|ab32b05b] -job allocate_interface(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152) = OK (0)
[error] container.go:784 Error running container: cgroup mountpoint not found for cpu
[/var/lib/docker|ab32b05b] -job start(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152) = OK (0)
[debug] server.go:925 Calling POST /containers/{name:.*}/resize
2014/03/22 01:56:11 POST /v1.10/containers/ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152/resize?h=47&w=203
[/var/lib/docker|ab32b05b] +job resize(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152, 47, 203)
bad file descriptor
[/var/lib/docker|ab32b05b] -job resize(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152, 47, 203) = ERR (1)
[error] server.go:951 Error: bad file descriptor
[/var/lib/docker|ab32b05b] +job release_interface(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152)
[/var/lib/docker|ab32b05b] -job release_interface(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152) = OK (0)
[error] container.go:841 ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152: Error closing terminal: invalid argument
[error] server.go:86 HTTP Error: statusCode=500 bad file descriptor
[debug] container.go:281 attach: stdout: end
[debug] container.go:319 attach: stderr: end
[debug] container.go:353 attach: job 1 completed successfully
[debug] container.go:348 attach: waiting for job 2/3
[debug] container.go:353 attach: job 2 completed successfully
[debug] container.go:348 attach: waiting for job 3/3
[debug] server.go:2211 Closing buffered stdin pipe
[debug] container.go:254 attach: stdin: end
[debug] container.go:353 attach: job 3 completed successfully
[debug] container.go:355 attach: all jobs completed successfully
[/var/lib/docker|ab32b05b] -job attach(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152) = OK (0)
[debug] server.go:925 Calling GET /containers/{name:.*}/json
2014/03/22 01:56:11 GET /v1.10/containers/ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152/json
[/var/lib/docker|ab32b05b] +job inspect(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152, container)
[/var/lib/docker|ab32b05b] -job inspect(ad120add18903db34484c617d294e42194f29970d2a00cdc05e30c8744b67152, container) = OK (0)
[debug] server.go:925 Calling POST /containers/create
2014/03/22 01:56:57 POST /v1.10/containers/create
[/var/lib/docker|ab32b05b] +job create()
[/var/lib/docker|ab32b05b] -job create() = OK (0)
[debug] server.go:925 Calling POST /containers/{name:.*}/attach
2014/03/22 01:56:57 POST /v1.10/containers/cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5/attach?stderr=1&stdin=1&stdout=1&stream=1
[/var/lib/docker|ab32b05b] +job inspect(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5, container)
[/var/lib/docker|ab32b05b] -job inspect(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5, container) = OK (0)
[/var/lib/docker|ab32b05b] +job attach(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5)
[debug] container.go:227 attach: stdin: begin
[debug] container.go:264 attach: stdout: begin
[debug] container.go:302 attach: stderr: begin
[debug] container.go:348 attach: waiting for job 1/3
[debug] server.go:925 Calling POST /containers/{name:.*}/start
2014/03/22 01:56:57 POST /v1.10/containers/cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5/start
[/var/lib/docker|ab32b05b] +job start(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5)
[/var/lib/docker|ab32b05b] +job allocate_interface(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5)
[/var/lib/docker|ab32b05b] -job allocate_interface(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5) = OK (0)
[error] container.go:784 Error running container: cgroup mountpoint not found for cpu
[/var/lib/docker|ab32b05b] -job start(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5) = OK (0)
[/var/lib/docker|ab32b05b] +job release_interface(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5)
[/var/lib/docker|ab32b05b] -job release_interface(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5) = OK (0)
[error] container.go:841 cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5: Error closing terminal: invalid argument
[debug] container.go:281 attach: stdout: end
[debug] container.go:319 attach: stderr: end
[debug] container.go:353 attach: job 1 completed successfully
[debug] container.go:348 attach: waiting for job 2/3
[debug] container.go:353 attach: job 2 completed successfully
[debug] container.go:348 attach: waiting for job 3/3
[debug] server.go:2211 Closing buffered stdin pipe
[debug] container.go:254 attach: stdin: end
[debug] container.go:353 attach: job 3 completed successfully
[debug] container.go:355 attach: all jobs completed successfully
[/var/lib/docker|ab32b05b] -job attach(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5) = OK (0)
[debug] server.go:925 Calling POST /containers/{name:.*}/resize
2014/03/22 01:56:57 POST /v1.10/containers/cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5/resize?h=47&w=203
[/var/lib/docker|ab32b05b] +job resize(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5, 47, 203)
bad file descriptor
[/var/lib/docker|ab32b05b] -job resize(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5, 47, 203) = ERR (1)
[error] server.go:951 Error: bad file descriptor
[error] server.go:86 HTTP Error: statusCode=500 bad file descriptor
[debug] server.go:925 Calling GET /containers/{name:.*}/json
2014/03/22 01:56:57 GET /v1.10/containers/cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5/json
[/var/lib/docker|ab32b05b] +job inspect(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5, container)
[/var/lib/docker|ab32b05b] -job inspect(cbe0c7e95da14510dfa9e5706149746c25e7edc7b5ebe92c54a55561fd47bbe5, container) = OK (0)

sysInfo:

$ sudo 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

$ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 13.10
Release:    13.10
Codename:   saucy

$ uname -a
Linux ip-10-0-1-37 3.11.0-15-generic #25-Ubuntu SMP Thu Jan 30 17:22:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

issue does not repro after sudo apt-get install cgroup-lite

@simapple
Copy link

gentoo get this error

@tianon
Copy link
Member

tianon commented Mar 23, 2014

@simapple can you give a little more information about your setup? ie, how did you install Docker? OpenRC or systemd? Which versions of all the affected software (especially Docker version and OpenRC/systemd versions)? Did you double check all the kernel flags that the "app-emulation/docker" ebuild prompts you to enable?

@Zenithar
Copy link

Same on Archlinux

/proc/mounts

rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
dev /dev devtmpfs rw,nosuid,relatime,size=3927632k,nr_inodes=981908,mode=755 0 0
run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
/dev/dm-2 / btrfs rw,noatime,compress=lzo,ssd,space_cache,autodefrag,inode_cache 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /sys/fs/cgroup tmpfs rw,relatime,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/bfqio cgroup rw,nosuid,nodev,noexec,relatime,bfqio 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=21,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
tmpfs /tmp tmpfs rw 0 0
/dev/sda1 /boot ext4 rw,relatime,stripe=4,data=ordered 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=786356k,mode=700,uid=1000,gid=100 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=100 0 0

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

uname -a

Linux fr-31-02-13-932 3.13.6-1-ck #1 SMP PREEMPT Fri Mar 7 16:05:57 EST 2014 x86_64 GNU/Linux

docker run -t -i stackbrew/ubuntu:saucy bash

[error] client.go:2315 Error resize: Error: bad file descriptor

@Zenithar
Copy link

But it works on CoreOS via boot2docker.

@simapple
Copy link

I think to check kernel while install docker by source compile,will get the reason easy

@crosbymichael
Copy link
Contributor

This should be fixed in 0.9.1 now that it is released.

@skrat
Copy link

skrat commented Mar 27, 2014

I'm still getting

...container.go:788 Error running container: cgroup mountpoint not found for cpu

@guedressel
Copy link

Upgrade to 0.9.1 solved the problem for me. Thanks.

@skrat
Copy link

skrat commented Mar 28, 2014

Apparently this is a kernel build configuration issue. lxc-checkconfig revealed there is no CPU cgroup. Upgrade to 0.9.1 or git head did not solve it for me.

@tomasklapka
Copy link

I am trying Docker 0.9.1 on Debian and there is no cgroup-lite package. I got it working anyway.
If you have cgroups working (lxc-checkconfig outputs Cgroup checks as green enabled) it is necessary to mount everything correctly (which is done on Ubuntu by cgroup-lite scripts) where the relevant mounting parts, which fixed my issue, are:

# mounting
mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
for c in `tail -n +2 /proc/cgroups | awk '{ print $1 }'`; do
        mkdir /sys/fs/cgroup/$c
        mount -n -t cgroup -o $c cgroup /sys/fs/cgroup/$c
done
# unmounting
cd /sys/fs/cgroup
for d in `tail -n +2 /proc/cgroups | awk '{ print $1 }'`; do
        umount $d || true
done

cd ..
umount /sys/fs/cgroup || true

@tombh
Copy link

tombh commented Apr 2, 2014

Debian sid user here with the default aptitude installed version of docker 0.9.0 and I was getting the ...container.go:788 Error running container: cgroup mountpoint not found for cpu error in the daemon logs. Installing lxc with aptitude install lxc seemed to be what fixed it for me.

@y0j
Copy link

y0j commented Apr 3, 2014

Hi,
tomasklapka thank you for sharing your method!
It works for me as well.

@gdm85
Copy link
Contributor

gdm85 commented May 7, 2014

experienced same problem with 0.10.0 and Debian Wheezy, solution was to remove any cgroup entry from /etc/fstab (always let docker init script setup cgroups)

P.S. on Debian Wheezy it's advised to use Ubuntu packages as explained here: https://coderwall.com/p/wlhavw

@j4ckstraw
Copy link

I have the same Bad file descriptor problem.
Because I use 32 bit systems.
and I solved my problem by refrence this : https://github.com/docker-32bit/ubuntu/blob/master/build-image.sh

Hope to help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests