Unable to access in Runner

Hello! Help me pleas. Why is Fatal?

fatal: unable to access ‘http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@GitLabCE/roman/hello.git/’: Couldn’t resolve host ‘GitLabCE’

all text

Running with gitlab-ci-multi-runner 9.4.2 (6d06f2e)
on my-runner (6e9244d1)
Using Docker executor with image alpine:latest …
Using docker image sha256:94a80272fb1fbb569b33f19a3a0020e4dcbc3c9e5afa5ea0a008bcaabb417928 for predefined container…
Pulling docker image alpine:latest …
Using docker image alpine:latest ID=sha256:7328f6f8b41890597575cbaadc884e7386ae0acc53b747401ebce5cf0d624560 for build container…
Running on runner-6e9244d1-project-2-concurrent-0 via GitLabCE…
Cloning repository…
Cloning into ‘/builds/roman/hello’…
fatal: unable to access ‘http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@GitLabCE/roman/hello.git/’: Couldn’t resolve host ‘GitLabCE’
ERROR: Job failed: exit code 1

Hello rombo5
Here is the solution.


Just need to open /etc/gitlab-runner/config.toml file and add:
extra_hosts = [“yourhostname:youripddress”] And all is done.
For example (my file):

[[runners]]
name = “co1”
url = “http://co1/ci
token = “1ccc03308b71a1c9a10640326adf1a”
executor = “docker”
[runners.docker]
tls_verify = false
image = “co1:5000/pub/pub”
privileged = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
extra_hosts = [“co1:192.168.176.137”]
[runners.cache]

3 Likes

This worked, thank you so much. Spent a whole day fixing the issue