Gitlab Runner lottery - Could not resolve host: gitlab.com and other errors

Hi, I have problem with my Gitlab Runner. I’m running Runner on my linux server, using Docker. The problem is that the jobs sometimes are failing, giving me following three types messages:

fatal: unable to access 'https://gitlab.com/xxx/xxx.git/': Could not resolve host: gitlab.com

or

WARNING: Ignoring http://dl-2.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)

or

ERROR: Job failed (system failure): Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.0.1:53: read udp 192.168.0.42:52276->192.168.0.1:53: i/o timeout (docker.go:142:11s)

I’m retrying jobs until they are completed but it drives me mad…

Here is my runner config:
concurrent = 10
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
      name = "xxx"
      url = "https://gitlab.com/"
      token = "xxx"
      executor = "docker"
      [runners.custom_build_dir]
      [runners.cache]
      [runners.docker]
            tls_verify = false
            image = "docker:latest"
            privileged = false
            disable_entrypoint_overwrite = false
            oom_kill_disable = false
            disable_cache = false
            volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
            shm_size = 0

Why sometimes it’s working and sometimes not?

Hi there!

It seems that your runner has some DNS issues every now and then. Have you tried to configure dns (like 8.8.8.8 or something like that) in The [runners.docker] section?

Best Regards,
Łukasz Korbasiewicz
GitLab Support

2 Likes

Hi,

I changed dns in runner config but it didn’t help. However it make me look at /etc/resolv.conf and I found that dns was set to my router 192.168.0.1 (it is my home server). I changed it to 8.8.8.8 and it seems to work perfectly now!

Dzięki for your help :wink: