rancher: cannot exec a container that has run and stopped

Rancher Version: 1.2.0

Docker Version: 1.12.3

OS and where are the hosts located? (cloud, bare metal, etc): 3.10.0-327.36.2.el7.x86_64

Setup Details: (single node rancher vs. HA rancher, internal DB vs. external DB) single node rancher, internal DB

Environment Type: (Cattle/Kubernetes/Swarm/Mesos) Cattle

Steps to Reproduce: Create service in stack. Open service in UI, trying to Execute Shell.

Results: Popup window opens and closes.

Expected: Popup window is opened and you can work in container Bash.

When I ssh to host and try to: docker exec -it r-icms-postgresql-1-b347541b bash I got: rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: cannot exec a container that has run and stopped\n"

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 26 (9 by maintainers)

Most upvoted comments

I’m seeing the same thing in docker v1.13.0

+1 have the same issue on 17.06.2-ce

#docker ps -a
CONTAINER ID        IMAGE                                                         COMMAND                  CREATED             STATUS                        PORTS               NAMES
cd432e7515cf        aegis-paas.aliyun.com:5000/ak-my:20180406003259_unit-output   "/.r/r /bin/sh /ho..."   42 seconds ago      Up 40 seconds                                     r-project-ak-my3-1-49e5cab1

#docker exec -it cd432e7515cf bash
rpc error: code = 2 desc = oci runtime error: exec failed: cannot exec a container that has stopped

reproducted in v1.13.0

~# docker exec -it fc114db9dca4 bash
rpc error: code = 2 desc = oci runtime error: exec failed: cannot exec a container that has run and stopped
~# docker info
Containers: 13
 Running: 9
 Paused: 0
 Stopped: 4
Images: 26
Server Version: 1.13.0
Storage Driver: aufs
 Root Dir: /data00/docker/aufs
 Backing Filesystem: extfs
 Dirs: 125
 Dirperm1 Supported: 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: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e
runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e
init version: 949e6fa
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 62.69 GiB
Name: n6-027-107
ID: RHPD:ZDXK:SFXG:D4QD:YXNG:KCAG:GZMJ:6RJY:YTNG:OZTD:VAHJ:CRYA
Docker Root Dir: /data00/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No kernel memory limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 http://67a95a0b.m.daocloud.io/
Live Restore Enabled: false

~# docker version
Client:
 Version:      1.13.0
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   49bf474
 Built:        Tue Jan 17 09:44:08 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.0
 API version:  1.25 (minimum version 1.12)
 Go version:   go1.7.3
 Git commit:   49bf474
 Built:        Tue Jan 17 09:44:08 2017
 OS/Arch:      linux/amd64
 Experimental: false

This is a docker bug marked fixed in 1.12.3 (the server version is the relevant one here, not client). https://github.com/docker/docker/issues/27540