Gitlab CI: Gitlab Runner Can’t Fetch Changes from Repository


Gitlab Runner can’t fetch changes from repository while running jobs:

Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/root/unity-ci-test/.git/
fatal: unable to access '': Could not resolve host:
ERROR: Job failed: exit code 1


  • Gitlab CE 12.7.6
  • Gitlab Runner 12.7.1


For some reason, such as firewall setup, the runner can’t reach the Gitlab’s exposed URL. You need to set a reachable clone_url in Gitlab Runner’s config.toml.

For example:

  name = "test-runner"
  url = ""
  token = "PzgMxRCqfHiNiPJyLQRC"
  executor = "docker"
  clone_url = ""

Then restart the Gitlab Runner:

# gitlab-runner restart


Leave a Comment