Gitlab Pipeline 失败“远程:HTTP Basic:访问被拒绝”

Dus*_*tin 6 pipeline gitlab gitlab-ci gitlab-ci-runner gitlab-runner

我是 Gitlab Pipelines 的新手,想为我的一个 Python 项目设置一个。我将 docker GitLab-runner 容器与此配置文件一起使用:

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
Run Code Online (Sandbox Code Playgroud)

每当执行管道时,我都会收到以下错误消息:

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
Run Code Online (Sandbox Code Playgroud)

Gitlab Runner 被分配给一个项目。我已经尝试重置所有内容并将其与我的 IP 地址、DNS 地址、本地 IP、本地设备名称一起使用,但还没有任何效果

我读到其他人也有同样的问题,大部分是在 2016 年或更早的时候。我有什么遗漏的吗?是否有我必须正确设置的设置?

编辑:谢谢@Vadim 更正我的标签

经过更多测试后,我对公共存储库进行了相同的尝试。令我惊讶的是,它成功了。问题是授权。我仍然需要在配置中添加尽可能多的内容,测试它是否影响公共存储库,然后使用私有存储库进行尝试。我会不断更新,因为我听说其他人也有同样的问题

Bra*_*man 17

就我而言,gitlab 位于内置 traefik 代理之外的代理后面。我相信这导致了使用此设置的必要性。注册跑步者后,编辑 config.toml 并添加clone_URL

[[runners]]
  url = "https://gitlab.example.com"
  clone_url = "https://gitlab.example.com"
Run Code Online (Sandbox Code Playgroud)

这为我解决了这个问题。

  • 非常感谢,“clone_url”行救了我。如果您担心的话,我建议重新启动 docker:`docker restart gitlab-runner` (2认同)