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

2024-04-15

我是 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

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

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

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

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

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

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


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

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

这为我解决了这个问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Gitlab Pipeline 失败“远程:HTTP Basic:访问被拒绝” 的相关文章

随机推荐