Docker.sock error with gitlab-runner

Hi Everyone

After successfully installing a self-hosted gitlab server, setting up a repo and CI, and deploying code to an application server, I have run into a persistent fault that has blocked me now for 2 days. Nothing I have tried from any online help sources has made any difference.

Any/all stages fail with this error:

Running with gitlab-ci-multi-runner 9.5.1 (96b34cc)
on Ubu (99292b2d)
Using Docker executor with image php:7.1 …
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Will be retried in 3s …
Using Docker executor with image php:7.1 …
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Will be retried in 3s …
Using Docker executor with image php:7.1 …
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Will be retried in 3s …
ERROR: Job failed (system failure): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

As far as I can work out, the error did not emerge from anything I changed. I created a second brand new gitlab server instance and tried various configurations on two different application servers, reinstalled gitlab-runner, deleted and reinstalled all runner registrations, tried changing settings in config.toml, and absolutely nothing has worked.

Has anyone else come across this problem?

Any help/suggestions would be most welcome.

Thanks

John

1 Like

I had the same issue.
By any chance did you follow the DigitalOcean tutorial?

My problem was that I forgot to install Docker.
I used the DigitalOcean Docker Install guide to install Docker (just step 1) and I got past this error but came across another.

I believe the new error is unrelated, as I am using my own home server, which doesn’t have a URL; need to tweak so it uses an IP for the repo instead.

Thanks for the reply Niall.

You were right, it was that docker wasn’t running. Curiously, it had been running at the time of the first setup when everything succeeded, and I didn’t notice that it had stopped. I still don’t understand why it stopped either - all I know is that once I checked the docker service status and started it, the problem was solved.

2 Likes