6

I'm trying to execute bash in my docker container called "bind" via

docker exec -it bind bash

I'm getting the following error message:

rpc error: code = 2 desc = oci runtime error: exec failed: 
container_linux.go:247: starting container process caused "process_linux.go:110: 
decoding init error from pipe caused \"read parent: connection reset by peer\""

There's nothing extraordinary in the logs. Restarting docker or the container seemed to have no effect. I also made sure that there's enough space on the hard drive. Starting any other binary in the container yields the same error.

version info:

docker --version:

Docker version 1.13.1, build 07f3374/1.13.1

OS:

cat /etc/redhat-release 

CentOS Linux release 7.6.1810 (Core) 

Any help would be appreciated.

Fang
  • 2,199
  • 4
  • 23
  • 44

7 Answers7

8

It seems to be a bug introduced in a recent update to the docker RPM packages. A temporary workaround is to downgrade all docker packages to a previous release (75 seems to work).

yum downgrade docker-1.13.1-75.git8633870.el7_5 \
              docker-client-1.13.1-75.git8633870.el7_5 \
              docker-common-1.13.1-75.git8633870.el7_5 \
              docker-rhel-push-plugin-1.13.1-75.git8633870.el7_5
wuyw
  • 3
  • 1
Christoffer Reijer
  • 1,925
  • 2
  • 21
  • 40
2

Here is the bug report on Red Hat's bugzilla : https://bugzilla.redhat.com/show_bug.cgi?id=1655214

2

if you use

yum update

before and no idea for what the old version of docker, just run

yum downgrade docker docker-client docker-common

it work for me

XQ DD
  • 59
  • 4
2

This is a known issue and has been fixed in newer docker packages: https://bugzilla.redhat.com/show_bug.cgi?id=1655214

For those with issues who cannot upgrade yet there is a workaround mentioned by William Brown in the issue that does not require a downgrade.

PID=docker inspect --format {{.State.Pid}} <name of container>
nsenter --target $PID --mount --uts --ipc --net --pid /bin/sh

Hope this works for you

Robin Sving
  • 1,902
  • 1
  • 12
  • 10
1

Today I installed an update of docker (version 1.13.1-84 on Centos) and since then I also have the same problem for all of my containers.

Downgrading to version 1.13.1-75 worked for me.

Greggy
  • 301
  • 1
  • 4
  • 11
0

I think this is because of lack of permissions.

Try running docker with sudo like below.

sudo docker exec -it bind bash

Hope this helps.

0

"Connection reset by peer", generally happens when there is a certain mismatch of ports. Like you have not exposed a port and trying to use it, or, improper port mappings. In fact if, it is service a being binded to localhost, please check it, because if you want to host a service, you might want to bind it to 0.0.0.0

This error could relate to quite a lot of issues. but, predominantly, it concords with binding wrong ports and, wrong IPs.

  • It is bound to 0.0.0.0. The only ports being forwarded are 53 and 10000. The bind inside the container works as well. It's only that I cannot docker exec into the container. – Fang Dec 04 '18 at 05:46
  • Thanks for that info Fang, can you please let me know how whats the command. ideally, it should be, docker exec -it "container_name" bash . in this case, you need to make sure, the container, should allow bash. can you please comment the same – Srinivas vaddi Dec 04 '18 at 08:36
  • 1
    I am seeing the same today. Just spun on a vanilla nginx on a clean VM. Running "docker exec test id" yields the same error. I am running Linux 3.10.0-693.el7.x86_64 and Docker 1.13.1. – Christoffer Reijer Dec 04 '18 at 08:53