moby: docker exec fails with exit code 255

Sometimes when I issue docker exec, it fails without printing any error messages and just exits with error code 255. The image I am using is docker-in-docker (dind) and there are some docker containers running inside this container which is probably relevant.

in docker.log I see:

INFO[0878] POST /v1.19/containers/017ac2609ad4/exec     
INFO[0878] POST /v1.19/exec/1362c8cd73fcde5242b8d48b9f0de75a503ab4ed33088d9e2fec570271d6488a/start 
WARN[0878] os: process already finished                 
ERRO[0878] Error running command in existing container 017ac2609ad48006eb319c72763dc66920b9bd527bf7bb1f207fd9e8fcd85db9: [8] System error: exit status 1 
ERRO[0878] Error starting exec command in container 1362c8cd73fcde5242b8d48b9f0de75a503ab4ed33088d9e2fec570271d6488a: Cannot run exec command 1362c8cd73fcde5242b8d48b9f0de75a503ab4ed33088d9e2fec570271d6488a in container 017ac2609ad48006eb319c72763dc66920b9bd527bf7bb1f207fd9e8fcd85db9: [8] System error: exit status 1 
ERRO[0878] Handler for POST /exec/{name:.*}/start returned error: Cannot run exec command 1362c8cd73fcde5242b8d48b9f0de75a503ab4ed33088d9e2fec570271d6488a in container 017ac2609ad48006eb319c72763dc66920b9bd527bf7bb1f207fd9e8fcd85db9: [8] System error: exit status 1 
ERRO[0878] HTTP Error                                    err=Cannot run exec command 1362c8cd73fcde5242b8d48b9f0de75a503ab4ed33088d9e2fec570271d6488a in container 017ac2609ad48006eb319c72763dc66920b9bd527bf7bb1f207fd9e8fcd85db9: [8] System error: exit status 1 statusCode=500
2015/08/20 00:22:31 http: response.WriteHeader on hijacked connection
2015/08/20 00:22:31 http: response.Write on hijacked connection
INFO[0878] POST /v1.19/exec/1362c8cd73fcde5242b8d48b9f0de75a503ab4ed33088d9e2fec570271d6488a/resize?h=17&w=140 
ERRO[0878] Handler for POST /exec/{name:.*}/resize returned error: bad file descriptor 
ERRO[0878] HTTP Error                                    err=bad file descriptor statusCode=500
INFO[0878] GET /v1.19/exec/1362c8cd73fcde5242b8d48b9f0de75a503ab4ed33088d9e2fec570271d6488a/json 

This happens in the parent container so it is bug in docker, not in dind.

uname -a

$ uname -a
Linux ubuntu2 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

docker version

Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

docker -D info

Containers: 2
Images: 82
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 88
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.11.0-15-generic
Operating System: Ubuntu precise (12.04.4 LTS)
CPUs: 2
Total Memory: 3.86 GiB
Name: ubuntu2
ID: SI3N:Y2HK:GSGO:O4IW:IT55:TGTY:6WCX:ZJ64:BNEO:KXUW:KNT6:AJFZ
WARNING: No swap limit support

The error code is the same as issue #9680, but this is a newer kernel.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (12 by maintainers)

Most upvoted comments

LOL

So, for the record, I’m a total moron - there is no /bin/bash in the image I was using… 😛