GitLab Runner - ERROR: Failed to remove network for build
Asked Answered
M

6

10

Here is my gitlab-ci.yml:

image: vibraniumcore/gcc-cmake-boost-mysqlcon
#image: gitlab/dind

stages:
  - test
  - build

Run Tests:
  stage: test
  tags:
    - c++
  script:
    - mkdir build
    - cd build
    - cmake ..
    - cmake --build . --target VibraniumCoreTests
    - cd ./Tests
    - ./VibraniumCoreTests

Build VibraniumCore:
  stage: build
  tags:
    - c++
  script:
    - mkdir build
    - cd build
    - cmake ..
    - cmake --build .

Build AuthServer:
  stage: build
  tags:
  - c++
  script:
    - cd Scripts
    - ./build_authserver.sh

Build WorldServer:
  stage: build
  tags:
  - c++
  script:
    - cd Scripts
    - ./build_worldserver.sh

When I try to run my pipeline I get this error:

Running with gitlab-runner 13.1.1 (6fbc7474)
  on GCC-CMAKE HdBd6UX6
Preparing the "docker" executor
00:35
ERROR: Failed to remove network for build
ERROR: Preparation failed: error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/info: read unix @->/var/run/docker.sock: read: connection reset by peer (docker.go:894:4s)
Will be retried in 3s ...
ERROR: Failed to remove network for build
ERROR: Preparation failed: error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/info: read unix @->/var/run/docker.sock: read: connection reset by peer (docker.go:894:10s)
Will be retried in 3s ...
ERROR: Failed to remove network for build
ERROR: Preparation failed: error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/info: read unix @->/var/run/docker.sock: read: connection reset by peer (docker.go:894:10s)
Will be retried in 3s ...
ERROR: Job failed (system failure): error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/info: read unix @->/var/run/docker.sock: read: connection reset by peer (docker.go:894:10s)

Any idea why I get this error and how can I fix it?

Mcneill answered 8/12, 2021 at 9:44 Comment(2)
How do you configure gitlab CI, maybe gitlab can not join docker endpoint (docs.gitlab.com/ee/ci/docker/…) and that's not cause by your pipeline script.Envy
re-trying it seems to make it work, sometimesLoughlin
C
6

If you want to have your runner setup with executor="docker", you may encounter the "ERROR: Failed to remove network for build" error if you have not installed docker on your machine hosting the runner.

In Ubuntu, try:

sudo apt install docker.io

And then re-run the pipeline.

Catalyst answered 17/6, 2022 at 21:26 Comment(3)
This solution works for me on Ubuntu 20.04.4 LTS.Buckhound
This worked for me on Ubuntu 22, thank you!Clarsach
This didn't help for me in Ubuntu 22.10. The problem could be that the image is not specified instead (that partially solved this error message for me).Globin
B
1

If docker is installed but you are still getting the error then you need to give the user permissions to use docker:

usermod -aG docker gitlab-runner
Bentonbentonite answered 8/8, 2023 at 9:51 Comment(0)
F
0

I had the same issue. I used "sudo gitlab-runner register" instead of "gitlab-runner register" and in my case the issue resolved.

Flotage answered 14/6, 2022 at 9:20 Comment(0)
T
0

You have to add an image to you job.

run_tests:
 stage: test
 image: vibraniumcore/gcc-cmake-boost-mysqlcon # add this line here
 tags:
  - c++
 ...

Or use default image:

default:   # add this line here
 image: vibraniumcore/gcc-cmake-boost-mysqlcon

run_tests:
 stage: test
 ...
Terrify answered 12/5, 2023 at 19:4 Comment(0)
P
-1

For me I had forgotten to start Docker by opening Docker Desktop

Placeman answered 16/4 at 13:10 Comment(2)
@Redz It does answer the question, I got that same exact error and this was my fix for it. It's not gonna be the answer for everybody, but it might help somePlaceman
Sorry, that is fair! Apologies for the misreview.Refluent
L
-5

This issue is due to the executor="docker" you are using in gitlab runner. try to change to "shell" or "ssh"

Lesley answered 16/3, 2022 at 17:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.