Docker exec fails on ARM64 linux machine
- [x] This is a bug report
- [ ] This is a feature request
- [x] I searched existing issues before opening this one
Expected behavior
Docker exec works, and traps into a docker previously started with run -itd.
Actual behavior
Docker exec failed with: rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "open /proc/self/fd: no such file or directory"
Steps to reproduce the behavior
docker run -itd <IMAGE_ID> /bin/bash docker exec -it <CONTAINER_ID> /bin/bash
Running docker run -it <IMAGE_ID> /bin/bash works as expected.
Output of docker version:
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Wed Jul 12 01:23:30 2017
OS/Arch: linux/arm64
Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Wed Jul 12 01:23:30 2017
OS/Arch: linux/arm64
Experimental: false
Output of docker info:
Containers: 27
Running: 1
Paused: 0
Stopped: 26
Images: 149
Server Version: 17.05.0-ce
Storage Driver: overlay
Backing Filesystem: extfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.4.38-rt49-tegra
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: aarch64
CPUs: 6
Total Memory: 6.504GiB
Name: REDACTED
ID: REDACTED
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: REDACTED
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
Additional environment details (AWS, VirtualBox, physical, etc.) OS version: Ubuntu 16.04 The docker is originally built from source code docker-aarch64-17.05.0-ce.tar.gz.
Docker 17.05.0-ce was not originally supported for aarch64.
Can you try this with the 17.09 release?
Installation instructions:
# Executing docker install script, commit: 716f7ca
apt-get update -qq >/dev/null
apt-get install -y -qq apt-transport-https ca-certificates curl software-properties-common >/dev/null
curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null
echo "deb [arch=arm64] https://download.docker.com/linux/ubuntu xenial edge" > /etc/apt/sources.list.d/docker.list
apt-get update -qq >/dev/null
apt-get install -y -qq docker-ce >/dev/null
I got the same error after upgrading docker version. The docker version command gives me:
Client:
Version: 17.07.0-ce
API version: 1.31
Go version: go1.8.3
Git commit: 8784753
Built: Tue Aug 29 17:42:57 2017
OS/Arch: linux/arm64
Server:
Version: 17.07.0-ce
API version: 1.31 (minimum version 1.12)
Go version: go1.8.3
Git commit: 8784753
Built: Tue Aug 29 17:41:18 2017
OS/Arch: linux/arm64
Experimental: false
Ping on this. This is currently blocking me.
Are you having this problem with any image? Can you provide the exact steps to reproduce (with an actual image, instead of <image>?
@thaJeztah @seemethere same here with alpine image and 17.09:
ubuntu@nvidia:~$ uname -m
aarch64
ubuntu@nvidia:~$ docker --version
Docker version 17.09.0-ce, build afdb6d4
ubuntu@nvidia:~$ docker run --detach --name alpine -ti alpine sh
bf1d379b35e99b3789d770ee1e077f410d68918eb0c08c19c25cd3de20bfd039
ubuntu@nvidia:~$ docker ps |grep alpine
bf1d379b35e9 alpine "sh" 8 seconds ago Up 7 seconds alpine
ubuntu@nvidia:~$ docker exec -ti alpine sh
oci runtime error: exec failed: container_linux.go:265: starting container process caused "open /proc/self/fd: no such file or directory"
@chaoflow not entirely sure what could be going on
I ran that exact workflow on an arm64 machine that we have and got this:
root@pkt-04:~# docker version
Client:
Version: 17.11.0-ce
API version: 1.34
Go version: go1.8.3
Git commit: 1caf76c
Built: Mon Nov 20 18:33:07 2017
OS/Arch: linux/arm64
Server:
Version: 17.11.0-ce
API version: 1.34 (minimum version 1.12)
Go version: go1.8.3
Git commit: 1caf76c
Built: Mon Nov 20 18:31:16 2017
OS/Arch: linux/arm64
Experimental: false
root@pkt-04:~# docker run --detach --name alpine -ti alpine sh
09f3e729fd87ad9149c4c62ffbaf844285ae658e7c900ce6c489d667c2ca7e6e
root@pkt-04:~# docker ps |grep alpine
09f3e729fd87 alpine "sh" 8 seconds ago Up 7 seconds alpine
root@pkt-04:~# docker exec -ti alpine sh
/ # exit
root@pkt-04:~#
@seemethere thanks for the fast response! Now as well on 17.11, but same problem:
ubuntu@nvidia:~$ docker version
Client:
Version: 17.11.0-ce
API version: 1.34
Go version: go1.8.3
Git commit: 1caf76c
Built: Mon Nov 20 18:33:07 2017
OS/Arch: linux/arm64
Server:
Version: 17.11.0-ce
API version: 1.34 (minimum version 1.12)
Go version: go1.8.3
Git commit: 1caf76c
Built: Mon Nov 20 18:31:16 2017
OS/Arch: linux/arm64
Experimental: false
ubuntu@nvidia:~$ docker rm --force alpine
alpine
ubuntu@nvidia:~$ docker run --detach --name alpine -ti alpine sh
b2aee24a0886fefbd1ef8c50e8d3d9164500a4d1661b116615e5bc678f19429c
ubuntu@nvidia:~$ docker ps |grep alpine
b2aee24a0886 alpine "sh" 6 seconds ago Up 5 seconds alpine
ubuntu@nvidia:~$ docker exec -ti alpine sh
OCI runtime exec failed: exec failed: container_linux.go:295: starting container process caused "open /proc/self/fd: no such file or directory": unknown
ubuntu@nvidia:~$
@chaoflow can you try to do a docker pull alpine before running the container?
I'm thinking you may have an outdated alpine image on that particular node.
@seemethere The alpine image is up-to-date; pull did not result in a newer image.
More testing:
$ docker run --privileged --name df-docker -d docker:17.11.0-dind
$ docker run --rm -it --link df-docker:docker docker:17.11.0 sh
# In docker container shell
$ docker run --detach --rm --name alpine -ti alpine sh
$ docker exec -ti alpine sh
OCI runtime exec failed: exec failed: container_linux.go:295: starting container process caused "open /proc/self/fd: no such file or directory": unknown
dockerd log for failing exec command:
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.777281520-08:00" level=debug msg="Calling GET /_ping"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.778294887-08:00" level=debug msg="Calling GET /v1.34/containers/alpine/json"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.783215345-08:00" level=debug msg="Calling POST /v1.34/containers/alpine/exec"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.783482431-08:00" level=debug msg="form data: {\"AttachStderr\":true,\"AttachStdin\":true,\"AttachStdout\":true,\"Cmd\":[\"sh\"],\"Detach\":false,\"DetachKeys\":\"\",\"Env\":null,\"Privileged\":false,\"Tty\":true,\"User\":\"\"}"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.784980848-08:00" level=debug msg="Calling POST /v1.34/exec/b6f6fd35a6035ac88c0a3b33ffa994298887320f04edc164e7019bdb39f5845a/start"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.785160538-08:00" level=debug msg="form data: {\"Detach\":false,\"Tty\":true}"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.785411976-08:00" level=debug msg="starting exec command b6f6fd35a6035ac88c0a3b33ffa994298887320f04edc164e7019bdb39f5845a in container 191446388f9ffd306a274bcb5cb46a8455d58862cc1b18c1aa34ebd92c5b5ba6"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.785691543-08:00" level=debug msg="attach: stdout: begin"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.785745370-08:00" level=debug msg="attach: stdin: begin"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.786203603-08:00" level=debug msg="Calling POST /v1.34/exec/b6f6fd35a6035ac88c0a3b33ffa994298887320f04edc164e7019bdb39f5845a/resize?h=60&w=106"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34-08:00" level=debug msg="event published" module="containerd/events" ns=moby topic="/tasks/exec-added" type=containerd.services.events.v1.TaskExecAdded
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.788916454-08:00" level=debug msg=event module=libcontainerd namespace=moby topic=/tasks/exec-added
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.860321215-08:00" level=error msg="stream copy error: reading from a closed fifo"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.860702292-08:00" level=debug msg="attach: stdout: end"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.860782456-08:00" level=debug msg="attach: stdin: end"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.887014500-08:00" level=error msg="Error running exec b6f6fd35a6035ac88c0a3b33ffa994298887320f04edc164e7019bdb39f5845a in container: OCI runtime exec failed: exec failed: container_linux.go:295: starting container process caused \"open /proc/self/fd: no such file or directory\": unknown"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.887211407-08:00" level=debug msg="Closing buffered stdin pipe"
Nov 29 07:19:34 nvidia dockerd[1659]: time="2017-11-29T07:19:34.887712042-08:00" level=debug msg="Calling GET /v1.34/exec/b6f6fd
@chaoflow just to check there's nothing special configured on your machine; I see nvidia as hostname; you don't happen to be running the nvidia-docker runtime? Any other specific configurations? (perhaps you can add the output of docker info as well?
@thaJeztah It's an nvidia tegra board, no nvidia runtime. Output of docker info below:
Containers: 19
Running: 2
Paused: 0
Stopped: 17
Images: 28
Server Version: 17.11.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 992280e8e265f491f7a624ab82f3e238be086e49
runc version: 0351df1c5a66838d0c392b4ac4cf9450de844e2d
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.4.38-rt49-tegra
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: aarch64
CPUs: 6
Total Memory: 6.504GiB
Name: nvidia
ID: REPLACED_BECAUSE_UNSURE_WHETHER_PRIVATE
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 31
Goroutines: 42
System Time: 2017-11-29T10:40:14.349930423-08:00
EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
and check-config.sh
ubuntu@nvidia:~$ /usr/share/docker-ce/contrib/check-config.sh
info: reading kernel config from /proc/config.gz ...
Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: enabled (as module)
- CONFIG_BRIDGE: enabled (as module)
- CONFIG_BRIDGE_NETFILTER: enabled (as module)
- CONFIG_NF_NAT_IPV4: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NETFILTER_XT_MATCH_IPVS: enabled
- CONFIG_IP_NF_NAT: enabled
- CONFIG_NF_NAT: enabled
- CONFIG_NF_NAT_NEEDED: enabled
- CONFIG_POSIX_MQUEUE: enabled
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_CGROUP_PIDS: enabled
- CONFIG_MEMCG_SWAP: missing
- CONFIG_MEMCG_SWAP_ENABLED: missing
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: missing
- CONFIG_IOSCHED_CFQ: enabled
- CONFIG_CFQ_GROUP_IOSCHED: missing
- CONFIG_CGROUP_PERF: missing
- CONFIG_CGROUP_HUGETLB: missing
- CONFIG_NET_CLS_CGROUP: missing
- CONFIG_CGROUP_NET_PRIO: missing
- CONFIG_CFS_BANDWIDTH: missing
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_RT_GROUP_SCHED: missing
- CONFIG_IP_VS: enabled
- CONFIG_IP_VS_NFCT: missing
- CONFIG_IP_VS_RR: missing
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: enabled
- CONFIG_EXT4_FS_SECURITY: enabled
- Network Drivers:
- "overlay":
- CONFIG_VXLAN: missing
Optional (for encrypted networks):
- CONFIG_CRYPTO: enabled
- CONFIG_CRYPTO_AEAD: enabled
- CONFIG_CRYPTO_GCM: missing
- CONFIG_CRYPTO_SEQIV: missing
- CONFIG_CRYPTO_GHASH: missing
- CONFIG_XFRM: enabled
- CONFIG_XFRM_USER: enabled
- CONFIG_XFRM_ALGO: enabled
- CONFIG_INET_ESP: enabled
- CONFIG_INET_XFRM_MODE_TRANSPORT: enabled
- "ipvlan":
- CONFIG_IPVLAN: missing
- "macvlan":
- CONFIG_MACVLAN: missing
- CONFIG_DUMMY: missing
- "ftp,tftp client in container":
- CONFIG_NF_NAT_FTP: enabled
- CONFIG_NF_CONNTRACK_FTP: enabled
- CONFIG_NF_NAT_TFTP: enabled
- CONFIG_NF_CONNTRACK_TFTP: enabled
- Storage Drivers:
- "aufs":
- CONFIG_AUFS_FS: missing
- "btrfs":
- CONFIG_BTRFS_FS: missing
- CONFIG_BTRFS_FS_POSIX_ACL: missing
- "devicemapper":
- CONFIG_BLK_DEV_DM: enabled
- CONFIG_DM_THIN_PROVISIONING: missing
- "overlay":
- CONFIG_OVERLAY_FS: enabled
- "zfs":
- /dev/zfs: missing
- zfs command: missing
- zpool command: missing
Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000
Thanks! Nothing that stands out in that information, so no ideas at this moment 😕
A workaround to enter a running container as an alternative to docker exec:
sudo nsenter --target \
$(docker inspect --format {{.State.Pid}} NAME) \
--mount --uts --ipc --net --pid /usr/sbin/chroot \
/new_root sudo -Hu USER -- bash -li
- NAME: name of container
- USER: user inside the container
Seems to work fine now on ubuntu-xenial with aarch64 and docker-ce 18.01.0-ce. Closing for now.
@seemethere Can we reopen this? I'm still seeing this on version 18.01.0-ce:
$ docker version
Client:
Version: 18.01.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: 03596f5
Built: Wed Jan 10 20:14:37 2018
OS/Arch: linux/arm64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.01.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: 03596f5
Built: Wed Jan 10 20:12:43 2018
OS/Arch: linux/arm64
Experimental: false
$ docker run --detach --rm --name alpine -ti alpine sh
ff4b8fb51f21058cd940719460c9d7ccafdd6a5212c5c5bc357380b933011d57
$ docker exec -ti alpine sh
OCI runtime exec failed: exec failed: container_linux.go:296: starting container process caused "open /proc/self/fd: no such file or directory": unknown
@seemethere just FYI, this issue has not been resolved from my end either.
Alright I will look into it and see if I can reproduce. What OS are you using?
Still unable to reproduce on Ubuntu 16.04:
root@eli-pet:~# docker version
Client:
Version: 18.02.0-ce
API version: 1.36
Go version: go1.9.3
Git commit: fc4de44
Built: Wed Feb 7 21:11:48 2018
OS/Arch: linux/arm64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.02.0-ce
API version: 1.36 (minimum version 1.12)
Go version: go1.9.3
Git commit: fc4de44
Built: Wed Feb 7 21:09:57 2018
OS/Arch: linux/arm64
Experimental: false
root@eli-pet:~# docker run --detach --rm --name alpine -ti alpine sh
21d2ba7dfe1a34fb5a6e2e24154bce3c506b9a277eb8799238e5498f924ad4ed
root@eli-pet:~# docker exec -ti alpine sh
/ # exit
root@eli-pet:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial