I’m encountering an issue with GitLab Runner where the URL of my repository is being altered, and the port is removed. I have a GitLab project accessible at the following URL: http://192.168.181.106:8081/sarra/check_runner.git. However, when running a job in GitLab Runner, I see that the URL becomes http://192.168.181.106/sarra/check_runner.git, leading to a connection error. Here’s the error message I receive:
Fatal: unable to access 'http://192.168.181.106/sarra/check_runner.git/': Failed to connect to 192.168.181.106 port 80 after 0 ms: Could not connect to server
ERROR: Job failed: exit code 1
Details:
GitLab Runner Version: 17.5.2
Environment: I am running the Runner with the docker executor on an ubuntu:latest image.
Steps I’ve Taken:
Checked Repository URL in GitLab:
The repository URL in my project settings is correctly configured with the port: http://192.168.181.106:8081/sarra/check_runner.git.
Registered the Runner:
When I registered the Runner, I used the correct URL: http://192.168.181.106:8081/.
Verified the Runner’s Configuration File:
I checked the /etc/gitlab-runner/config.toml file to ensure the URL is also correctly set there.
Restarted the GitLab Runner:
After verifying the configuration, I restarted the Runner to apply the changes.
Connectivity Tests:
I tested access to the URL with curl, and it works correctly:
curl -I http://192.168.181.106:8081/
Questions:
Why does the repository URL in GitLab Runner not retain the specified port?
Is there a configuration that I might have missed?
How can I resolve this issue so that the port is included in the URL when accessing the repository? is putting the container of gitlab and gitlab-runner can solve the problem?
PS: I used local dns and does not work.
Thank you in advance for your help!