circleci-cli icon indicating copy to clipboard operation
circleci-cli copied to clipboard

Fail in connect with docker

Open gustawdaniel opened this issue 4 years ago • 5 comments

daniel@hp-1589:~/pro/cm$ circleci local execute -c process.yml --job build
Error: failed to connect to docker; please ensure that docker is running, and that `docker version` succeeds
daniel@hp-1589:~/pro/cm$ docker --version
Docker version 19.03.12, build 48a66213fe
daniel@hp-1589:~/pro/cm$ docker version
Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:45:44 2020
 OS/Arch:           linux/amd64
 Experimental:      false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
daniel@hp-1589:~/pro/cm$ sudo service docker status
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-08-04 09:28:39 CEST; 1h 45min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 2863 (dockerd)
      Tasks: 26
     Memory: 130.5M
     CGroup: /system.slice/docker.service
             └─2863 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

sie 04 09:28:38 hp-1589 dockerd[2863]: time="2020-08-04T09:28:38.829980576+02:00" level=warning msg="Your kernel does not support cgroup rt runtime"
sie 04 09:28:38 hp-1589 dockerd[2863]: time="2020-08-04T09:28:38.829992050+02:00" level=warning msg="Your kernel does not support cgroup blkio weight"
sie 04 09:28:38 hp-1589 dockerd[2863]: time="2020-08-04T09:28:38.830003507+02:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
sie 04 09:28:38 hp-1589 dockerd[2863]: time="2020-08-04T09:28:38.830228671+02:00" level=info msg="Loading containers: start."
sie 04 09:28:39 hp-1589 dockerd[2863]: time="2020-08-04T09:28:39.077173404+02:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used t>
sie 04 09:28:39 hp-1589 dockerd[2863]: time="2020-08-04T09:28:39.133222316+02:00" level=info msg="Loading containers: done."
sie 04 09:28:39 hp-1589 dockerd[2863]: time="2020-08-04T09:28:39.222817051+02:00" level=info msg="Docker daemon" commit=48a66213fe graphdriver(s)=overlay2 version=19.03.12
sie 04 09:28:39 hp-1589 dockerd[2863]: time="2020-08-04T09:28:39.223960921+02:00" level=info msg="Daemon has completed initialization"
sie 04 09:28:39 hp-1589 dockerd[2863]: time="2020-08-04T09:28:39.259324956+02:00" level=info msg="API listen on /run/docker.sock"
sie 04 09:28:39 hp-1589 systemd[1]: Started Docker Application Container Engine.

System

uname -a
Linux hp-1589 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

gustawdaniel avatar Aug 04 '20 09:08 gustawdaniel

This helped me - https://support.circleci.com/hc/en-us/articles/360035524354-CircleCI-CLI-unable-to-connect-to-docker-on-Ubuntu-19-04-

I didn't reinstall docker, only circleci cli: sudo snap remove circleci sudo snap install --devmode circleci

I'm on Ubuntu 19.10.

Update: I got another error saying "Error: failed to start event processor: failed to compute task config: failed to read config file: read /tmp/local_build_config.yml: is a directory". It's also caused by the limitation of snap installation, so I had to: sudo snap remove circleci curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | sudo bash (alterantive installation option found at circleci website)

Now I can run the jobs locally.

antonxo avatar Oct 19 '20 08:10 antonxo

I'm still unable to connect to docker on ubuntu 20.10. Installing circleci in devmode did not help, and the curl->bash install also did not help. docker version is fine. Can anyone suggest further debugging steps?

christian-oudard avatar Apr 16 '21 18:04 christian-oudard

thanks @amatveiev. isn't there any update from circleci team yet?

hadi-alnehlawi avatar Aug 16 '21 02:08 hadi-alnehlawi

Yeah, also stuck on this issue, Mac arm64, Monterey

jamierpond avatar Nov 04 '22 17:11 jamierpond

On macOS, the thing for me was that I couldn't use the brew install docker, I had to use the desktop docker app.

jamierpond avatar Nov 04 '22 17:11 jamierpond