Dustin
Dustin

Reputation: 108

Gitlab Pipeline failing "remote: HTTP Basic: Access denied"

I'm new to Gitlab Pipelines and want to set up one for one of my Python projects. I'm using the docker GitLab-runner container with this Configuration file:

version: '3'
services:
  runner:
    container_name: runner
    image: gitlab/gitlab-runner:latest
    restart: unless-stopped
    environment:
      - TZ=Europe/Berlin
    volumes:
      - ./data:/etc/gitlab-runner/
      - /var/run/docker.sock:/var/run/docker.sock

Whenever a pipeline is executed I get this error message:

Running with GitLab-runner 14.10.1 (f761588f)
  on docker xxxxxxx
Preparing the "docker" executor
Using Docker executor with image python:latest ...
Pulling docker image python:latest ...
Using docker image sha256:8dec8e39f2eca1ee1f1b668619023da929039a39983de4433d42d25a7b79267c for python:latest with digest python@sha256:567018293e51a89db96ce4c9679fdefc89b3d17a9fe9e94c0091b04ac5bb4e89 ...
Preparing environment
Running on runner-xxxxxxxxx-project-38-concurrent-0 via xxxxxxxx...
Getting source from Git repository
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /builds/group/project/.git/
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://mygitlab.de/group/projekt.git/'
Cleaning up a project directory and file-based variables
ERROR: Job failed: exit code 1

The Gitlab Runner is assigned to a project. I already tried to reset everything and use it with my IP address, my DNS address, my local IP, my local device name but nothing worked yet

I read about others having the same problems, mostly in 2016 or older. Is there anything I'm missing? Is there a setting I have to set correctly?

EDIT: Thanks, @Vadim for correcting my tags

After some more testing, I tried the same with a public repository. And to my surprise, it worked. The Problem is the Authorisation. I still need to add as much as possible to my configuration, test if it affects the public repo, and then try it with a private repo. I will keep this more updated as I heard of others having the same problems

Upvotes: 6

Views: 8520

Answers (2)

Brandon Kauffman
Brandon Kauffman

Reputation: 1865

For my case, gitlab was behind a proxy other than the built-in traefik proxy. I believe this caused the necessity of using this setting. After registering your runner, edit the config.toml and and add the clone_URL

[[runners]]
  url = "https://gitlab.example.com"
  clone_url = "https://gitlab.example.com"

This solved the issue for me.

Upvotes: 18

quizguy
quizguy

Reputation: 169

One thing that might help you is to try and pass the actual IP in the extra hosts for the runner.

It should go into the config.toml for the runner something like extra_hosts = [ 192.1xx.x.x:mygitlab.de]

Upvotes: 0

Related Questions