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]

2 Likes

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

Good, worked for me too, in my case it was localhost and IP:

extra_hosts = [“localhost:xxx.xxx.xxx.xxx”]

Hi all, my github runner still not working.
below is my message.

Hello did you check your hostname if the direction is working in the GitLab-runner environment? it seems your hostname is not seen by your environment including GitLab-runner.

I have same problem by the way. I have also extra_hosts' flag in toml` file. However, I am still getting such an error:

Submodule 'module1' (https://ip_here/omer.guzel/module1.git) registered for path 'module1'
Synchronizing submodule url for 'module1'
Cloning into '/builds/tutellab/mkdocstest/module1'...
fatal: unable to access 'https://ip_here/omer.guzel/module1.git/': SSL certificate problem: unable to get local issuer certificate
fatal: clone of 'https://ip_here/omer.guzel/module1.git' into submodule path '/builds/tutellab/mkdocstest/module1' failed
Failed to clone 'module1'. Retry scheduled
Cloning into '/builds/tutellab/mkdocstest/module1'...
fatal: unable to access 'https://ip_here/omer.guzel/module1.git/': SSL certificate problem: unable to get local issuer certificate
fatal: clone of 'https://ip_here/omer.guzel/module1.git' into submodule path '/builds/tutellab/mkdocstest/module1' failed
Failed to clone 'module1' a second time, aborting

I am using a submodule inside the repo. I used also

variables:
  GIT_SUBMODULE_STRATEGY: recursive

lines in yml file.
I tried to add the project path in the submodule>settings>cicd>acces tokens but it gives this error at the top:

The target_project that you are attempting to access does not exist or you don't have permission to perform this action

whatever I wrote that region it gives this error. Could anyone help me to solve it?

Thanks. It works for me.