0

Same question was asked by myself before. But now I registered runner with sudo.

Yet I get following error in pipeline

Getting source from Git repository
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/sachith/awesome-project/.git/
fatal: unable to access 'https://gitlab.example.com:9000/sachith/awesome-project.git/': Failed to connect to gitlab.example.com port 9000 after 132262 ms: Operation timed out
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

I can clone the project as gitlab-runner user to runner running node. Therefore no connectivity issue.

also its added to visudo file gitlab-runner ALL=(ALL:ALL) ALL

Update : additional details

  1. Telnet connection to port gitlab 9000 from runner running node.
gitlab-runner@docker-registry:~$ telnet gitlab.example.com 9000
Trying 192.168.20.30...
Connected to gitlab.example.com.
Escape character is '^]'.
^]
telnet> q
Connection closed.
  1. Cloning projects with gitlab-runner user
gitlab-runner@docker-registry:~$ git clone https://gitlab.example.com:9000/sachith/my-project.git
Cloning into 'my-project'...
Username for 'https://gitlab.example.com:9000': sachith
Password for 'https://sachith@gitlab.example.com:9000': 
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 878 (delta 20), reused 0 (delta 0)
Receiving objects: 100% (878/878), 56.36 MiB | 36.34 MiB/s, done.
Resolving deltas: 100% (343/343), done.
  1. tcpdump between runner and gitlab server shows something similar to this

runner-ip gitlab-example.com-ip TLSv1.3 337 Client Hello

gitlab-example.com-ip runner-ip TLSv1.3 2187 Server Hello, Change Cipher Spec

/etc/gitlab-runner/config.toml

[[runners]]
  name = "Gitlab runner for My Project"
  url = "https://gitlab.example.com:9000/"
  token = "uWg-xxxxxxx"
  tls-ca-file = "/etc/gitlab-runner/certs/gitlab.example.com.crt"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "docker"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]
    shm_size = 0
6
  • 2
    Based on the output you copied, "...Failed to connect to gitlab.example.com port 9000 after 132262 ms...." I'd bet the runner is not able to connect to gitlab instance on port 9000. You wrote "I can clone the project as gitlab-runner" but it's not clear, from your message, what you really did, and on which command. Please check your firewalling/connectivity issues between the runner and the gitlab-instance (TCP port 9000 open). Alternatively, please provide (much) more details. Oct 4 at 6:16
  • 1
    @DamianoVerzulli I updated the question with more details. I noticed runner uses tls1.3 and gitlab server uses tls1.2 Oct 4 at 10:17
  • 1
    Can you post the /etc/gitlab-runner/config.toml settings? For Docker executors, I have had to manually add privileged = true under [runners.docker] to get past some build errors with unhelpful/confusing error messages.
    – zacran
    Oct 8 at 13:54
  • @zacran I think I had that config, I have posted config file Oct 9 at 7:24
  • 1
    Does this answer your question? Gitlab runner fails with connection timeout
    – Max N
    Oct 14 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.