最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

docker - CICD Fails with error message "fatal: unable to access 'xxx': The requested URL returned error

programmeradmin2浏览0评论

I deployed gitlab and gitlab-runner with docker. After that, I create a runner for my project in gitlab UI and registered the runner in gitlab-runner, when I create CICD pipeline, it failed with the error message:


Running with gitlab-runner 17.8.1 (a1fca00e)
  on irunner t3_4qSEmx, system ID: r_J04NUQAla3vC
Preparing the "docker" executor
01:29
Using Docker executor with image alpine:latest ...
Pulling docker image alpine:latest ...
Using docker image sha256:b0c9d60fc5e3fa2319a86ccc1cdf34c94c7e69766e8cebfb4111f7e54f39e8ff for alpine:latest with digest alpine@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 ...
Preparing environment
00:11
Running on runner-t34qsemx-project-3-concurrent-0 via 7f45da9b0b05...
Getting source from Git repository
00:10
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /builds/dev/g1/.git/
fatal: unable to access '.git/': The requested URL returned error: 403
Cleaning up project directory and file based variables
00:06
ERROR: Job failed: exit code 1

Below is the config.toml for the runner:


[[runners]]
  name = "irunner"
  url = ";
  id = 8
  token = "glrt-t3_4qSEmxWTbC8D7yvs4wUB"
  token_obtained_at = 2025-01-20T16:45:27Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    MaxUploadedArchiveSize = 0
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "alpine:latest"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
    network_mtu = 0

I went into the gitlab-runner docker, and tried using git clone with both httpand ssh way, the result was as follows:

root@7f45da9b0b05:/# git clone .git
Cloning into 'g1'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 28 (delta 8), reused 0 (delta 0), pack-reused 3 (from 1)
Unpacking objects: 100% (28/28), 5.05 KiB | 1.01 MiB/s, done.
root@7f45da9b0b05:/# ll
total 27
drwxr-xr-x    1 root root   6 Jan 20 15:49 ./
drwxr-xr-x    1 root root   6 Jan 20 15:49 ../
-rwxr-xr-x    1 root root   0 Jan 18 17:09 .dockerenv*
lrwxrwxrwx    1 root root   7 Oct 11 02:03 bin -> usr/bin/
drwxr-xr-x    2 root root   2 Apr 15  2020 boot/
drwxr-xr-x    5 root root 340 Jan 20 15:26 dev/
-rwxr-xr-x    1 root root 687 Nov 14 00:04 entrypoint*
drwxr-xr-x    1 root root   6 Jan 18 17:09 etc/
drwxr-xr-x    3 root root   5 Jan 20 15:49 g1/
...
...
root@7f45da9b0b05:/# rm -rf g1
root@7f45da9b0b05:/# git clone [email protected]:dev/g1.git
Cloning into 'g1'...
The authenticity of host 'gitlab.xxx (172.21.0.2)' can't be established.
ECDSA key fingerprint is SHA256:7SwHR8w8zynT/sU04MAH5wYzHvRNsL4d6yxKkrjXGIE.
Are you sure you want to continue connecting (yes/no/[fingerprint])? 

Was there any possible that it was the confirmation that caused the error.

I also tried cmd in the gitlab runner docker

root@7f45da9b0b05:/# curl 
<html><body>You are being <a href=";>redirected</a>.</body></html>root@7f45da9b0b05:/#

which seems to mean that the user from the gitlab-runner was not verified.

Can anyone help with the problems, much grateful

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论