Errors connecting to Docker socket
Summary
Sometime our jobs are failing because of that kind of error:
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (executor_docker.go:706:120s)
ERROR: Preparation failed: Error response from daemon: Conflict. The container name "/runner-3c611dd2-project-30-concurrent-0-docker-0" is already in use by container "cf411405e3f1c8da2b9da6dcc1742be8b8ac76e0af5b21ed9d943b8eed09454f". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:706:0s)
There was already such an issue: #2408 (closed), but people are still reporting that that issue is occurring.
Steps to reproduce
It occurs randomly
Actual behavior
Get error messages about not being able to connect to Docker socket or HTTP Docker endpoint
Expected behavior
A clean build
Relevant logs and/or screenshots
Running with gitlab-runner 11.2.0 (35e8515d)
on gitlab-runner-2 3c611dd2
Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:943cc2194c118472a134b2fee0bb7144c1c62ca415ff030d0cc00d43b81e29f7 for docker:dind ...
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (executor_docker.go:706:120s)
Will be retried in 3s ...
Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:943cc2194c118472a134b2fee0bb7144c1c62ca415ff030d0cc00d43b81e29f7 for docker:dind ...
ERROR: Preparation failed: Error response from daemon: Conflict. The container name "/runner-3c611dd2-project-30-concurrent-0-docker-0" is already in use by container "cf411405e3f1c8da2b9da6dcc1742be8b8ac76e0af5b21ed9d943b8eed09454f". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:706:0s)
Will be retried in 3s ...
Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:943cc2194c118472a134b2fee0bb7144c1c62ca415ff030d0cc00d43b81e29f7 for docker:dind ...
ERROR: Preparation failed: Error response from daemon: Conflict. The container name "/runner-3c611dd2-project-30-concurrent-0-docker-0" is already in use by container "cf411405e3f1c8da2b9da6dcc1742be8b8ac76e0af5b21ed9d943b8eed09454f". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:706:0s)
Will be retried in 3s ...
ERROR: Job failed (system failure): Error response from daemon: Conflict. The container name "/runner-3c611dd2-project-30-concurrent-0-docker-0" is already in use by container "cf411405e3f1c8da2b9da6dcc1742be8b8ac76e0af5b21ed9d943b8eed09454f". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:706:0s)
Environment description
ubuntu@gitlab-runner-2:~$ sudo docker info
[sudo] password for ubuntu:
Containers: 61
Running: 1
Paused: 0
Stopped: 60
Images: 14
Server Version: 17.09.1-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: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-134-generic
Operating System: Ubuntu 16.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 23.55GiB
Name: gitlab-runner-2
ID: XECY:O4PO:OAG4:MEB7:55TY:XFAS:IE5N:GXQF:5366:QS2J:JNA4:L4ZP
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
Used GitLab Runner version
ubuntu@gitlab-runner-2:~$ gitlab-runner --version
Version: 11.2.0
Git revision: 35e8515d
Git branch: 11-2-stable
GO version: go1.8.7
Built: 2018-08-22T15:57:53+00:00
OS/Arch: linux/amd64
Edited by 🤖 GitLab Bot 🤖