profile
viewpoint

Ask questionswrite unix /var/run/docker.sock->@: write: broken pipe

I'm sending commands to different containers; this was working correctly until a few days ago. Since then, the only thing that changed is; a new Docker version was released and I switched from a TCP connection to a socket connection. Rest of the commands execute fine.

Information:

This environment runs inside of a virtual machine with Debian Jessie.

$ docker version
Client:
 Version:      1.11.0
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   4dc5990
 Built:        Wed Apr 13 18:17:17 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.0
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   4dc5990
 Built:        Wed Apr 13 18:17:17 2016
 OS/Arch:      linux/amd64

$ docker info
Containers: 9
 Running: 6
 Paused: 0
 Stopped: 3
Images: 12
Server Version: 1.11.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 89
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.963 GiB
Name: docker-host
ID: 4NGE:LLRW:4LEL:CE6Q:S7BN:UZ6Q:LA6K:4WHG:PNRI:LHAD:TWFW:WDBJ
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support

$ uname -a
Linux docker-host 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06) x86_64 GNU/Linux

$ cat /etc/issue
Debian GNU/Linux 8 \n \l
Apr 21 07:35:46 docker-host docker[11709]: time="2016-04-21T07:35:46.790486036Z" level=error msg="attach: stdout: write unix /var/run/docker.sock->@: write: broken pipe"
Apr 21 07:35:46 docker-host docker[11709]: time="2016-04-21T07:35:46.931491694Z" level=error msg="Error running exec in container: attach failed with error: write unix /var/run/docker.sock->@: write: broken pipe\n"
Apr 21 07:35:46 docker-host docker[11709]: time="2016-04-21T07:35:46.931563085Z" level=error msg="Handler for POST /exec/fc6c278bc319d31ae125e6bfe62aab3bed6ae54d64223597e2c7a367fd540153/start returned error: attach failed with error: write unix /var/run/docker.sock->@: write: broken pipe"
Apr 21 07:35:46 docker-host docker[11709]: 2016/04/21 07:35:46 http: response.WriteHeader on hijacked connection
Apr 21 07:35:46 docker-host docker[11709]: 2016/04/21 07:35:46 http: response.Write on hijacked connection

Update: The problem occurs also when using a TCP connection: Update: When using a TCP connection there are less of these errors then when using a socket connection.

Apr 21 08:33:24 docker-host docker[25468]: time="2016-04-21T08:33:24.772961231Z" level=error msg="attach: stderr: write tcp 10.99.0.99:2375->172.17.0.2:40968: write: broken pipe"
Apr 21 08:33:25 docker-host docker[25468]: time="2016-04-21T08:33:25.890528192Z" level=error msg="Error running exec in container: attach failed with error: write tcp 10.99.0.99:2375->172.17.0.2:40968: write: broken pipe\n"
Apr 21 08:33:25 docker-host docker[25468]: time="2016-04-21T08:33:25.890563806Z" level=error msg="Handler for POST /exec/aca8b3206f70586afa35766edf858827b57dd1e7a5643878df1996c8c818f061/start returned error: attach failed with error: write tcp 10.99.0.99:2375->172.17.0.2:40968: write: broken pipe"
Apr 21 08:33:25 docker-host docker[25468]: 2016/04/21 08:33:25 http: response.WriteHeader on hijacked connection
Apr 21 08:33:25 docker-host docker[25468]: 2016/04/21 08:33:25 http: response.Write on hijacked connection

docker-php issue: https://github.com/docker-php/docker-php/issues/195

moby/moby

Answer questions sotona-

I'm getting same with 18.09.0 while stopping/starting 30 containers via docker-compose. But they writes summary ~100 messages per hour to stdout/stderr.

Related questions

start container failed with "failed to umount /var/lib/docker/containers/.../shm: no such file or directory" hot 122
start container failed with "failed to umount /var/lib/docker/containers/.../shm: no such file or directory" hot 76
upgrade docker-18.09.2-ce , shim.sock: bind: address already in use: unknown hot 56
runc regression - EPERM running containers from selinux hot 26
integration: "error reading the kernel parameter" errors during CI hot 26
Error response from daemon: rpc error: code = DeadlineExceeded desc = context deadline exceeded hot 24
Windows Server 2019 publish ports in swarm not working hot 24
Swarm restarts all containers hot 22
OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown hot 18
"docker stack deploy">"rpc error: code = 3 desc = name must be valid as a DNS name component" hot 18
hcsshim::PrepareLayer failed in Win32: The parameter is incorrect hot 18
Docker 18.09.1 doesn't work with iptables v1.8.2 hot 17
manifest invalid error when pushing image to quay.io hot 17
Can't set net.ipv4.tcp_tw_reuse in docker 1.10.3 hot 15
dockerd stopped responding to API requests; no installed keys could decrypt message hot 15
Github User Rank List