0

I am trying to set up gitlab-runner for CI / CD. When trying to run my build, it errors uniformly with the following:

Running with gitlab-ci-multi-runner 9.1.0 (0118d89) on web1 (27e4fda8) 
Using Docker executor with image meteorhacks/meteord:onbuild ... 
Using docker image sha256:29874b1497a5371d90e42eb5401c7471ce94a4bce218dcefb2249bbbcb6830ae for predefined container... 
Pulling docker image meteorhacks/meteord:onbuild ... 
Using docker image meteorhacks/meteord:onbuild ID=sha256:3776323ff75691de7182e5871bd9584671ee9ca066e26638327b44cc46f9a0c0 for build container... 
Running on runner-27e4fda8-project-3-concurrent-0 via web1... 
Cloning repository... 
Cloning into '/builds/foo/bar'... 
fatal: unable to access 'http://gitlab-ci-token:[email protected]/foo/bar.git/': 
Failed to connect to gitlab.foo.bar.net port 80: Operation timed out ERROR: Job failed: exit code 1

The odd part is that, from the runner box, I can run:

wget http://gitlab-ci-token:[email protected]/foo/bar.git/

This works with absolutely no timeout. So I don't know how to debug a network timeout if I can't reproduce it myself!

1 Answer 1

1

My setup had both gitlab and the gitlab-runner in docker containers. My gitlab had a static local ip and was in a custom docker network with the gitlab-runner.

I was having a similar problem, until I realized my gitlab runners were spawned in the default bridge network and thus didn't see my gitlab's address.

I fixed the problem simply by adding:

network_mode = "network_name" (ie. gitlab_default)

to my runners config.toml.

Hope this helps!

Sign up to request clarification or add additional context in comments.

2 Comments

"until I realized my gitlab runners were spawned in the default bridge network". Damn, if somebody told me that, I wouldn't have wasted all my Saturday on it. Thanks!
Thank you! After hours of googling it helped me. I am using gitlab with jwilder/nginx-proxy and runners couldn't connect to gitlab. But network_mode = "proxy" solved the problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.