GitLab runner cannot connect to Gitlab
Hi, sorry for my English.
Summary
Gitlab runner cannot connect to the local GitLab server.
Steps to reproduce
- Installed the GitLab from docker image (docker-compose.yml attached) on the dedicated server on OpenVPN interface 172.16.110.5. Port is 9419.
- Installed the Gitlab Runner from docker image (docker-compose.yml attached) too.
- Created project test.
- Registered docker-runner to the project with name "test". Was chosen options (docker, default-image: ruby:2.5)
- Uploaded simple gitlab-ci.yml
.gitlab-ci.yml
stages:
- test
test:
stage: test
script:
- echo "YES"
docker-compose.yml
version: "3.8"
services:
gitlab:
image: gitlab/gitlab-ce:latest
hostname: 172.16.110.5
ports:
- '9419:9419'
- '8022:22'
volumes:
- '.shared-files/config:/etc/gitlab'
- '.shared-files/logs:/var/log/gitlab'
- '.shared-files/data:/var/opt/gitlab'
gitlab-runner:
image: gitlab/gitlab-runner:latest
volumes:
- '.shared-files-runner/config:/etc/gitlab-runner'
- '/var/run/docker.sock:/var/run/docker.sock'
networks:
default:
external:
name: my-bridge-network-gitlab
Actual behavior
The job fails without executing any commands
Expected behavior
The job should output "test"
Relevant logs and/or screenshots
job log
Running with gitlab-runner 13.8.0 (775dd39d)
on f9eb9458580c nJcwhbpk
Preparing the "docker" executor
00:07
Using Docker executor with image ruby:2.5 ...
Pulling docker image ruby:2.5 ...
Using docker image sha256:34cbddf94f4141c44bca44cd99a03cbdd20c4872cc7f4369320e404712f9d5a3 for ruby:2.5 with digest ruby@sha256:ce2c3af412c09a7cb3f9359e96b5c39b73fd0b456ea80c126b2def2a75d5b2a6 ...
Preparing environment
00:03
Running on runner-njcwhbpk-project-12-concurrent-0 via f9eb9458580c...
Getting source from Git repository
02:13
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/beba/test/.git/
fatal: unable to access 'http://172.16.110.5:9419/beba/test.git/': Recv failure: Connection reset by peer
ERROR: Job failed: exit code 1
Environment description
config.toml contents
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "f9eb9458580c"
url = "http://gitlab:9419/"
token = "nJcwhbpkDNQLj9X-aCzE"
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
image = "ruby:2.5"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
Used GitLab Runner version
Version: 13.8.0 Git revision: 775dd39d Git branch: 13-8-stable GO version: go1.13.8 Built: 2021-01-20T13:32:47+0000 OS/Arch: linux/amd64
Possible fixes
Some details, what I doing to resolve the problem. After starting the job doing:
- docker ps
- docker exec -it ID_CONTAINER_JOB bash
- yum install nmap
- ping 172.16.110.5 -> OK
- ping giltab -> OK
- nmap 172.16.110.5 -p 9419 -> PORT OPEN
The project with the name "test" make public. At another server (172.16.110.1) make "git clone http://172.16.110.5:9419/beba/test.git" all works successfully.
What am I doing wrong? Thanks.