【发布时间】:2022-01-04 08:08:47
【问题描述】:
我的 gitlab 构建管道失败,因为它会运行 git ls-remote -q origin 指令,并报告错误说“找不到您要查找的项目”。
[2022/01/04 15:58:00] /go/pkg/mod/***/finance/alice@v0.9.63-0.20211231031838-f6dae3fdb8c4/kafkax/kafka_consumer.go:9:2: reading golang.***.com/kit/swimlane/go.mod at revision v0.0.1: git ls-remote -q origin in /go/pkg/mod/cache/vcs/d59e078efe804645d7b0bc877750c96d810a57328e3acc47eb94bdb969209bf9: exit status 128:
[2022/01/04 15:58:00] > GitLab: The project you were looking for could not be found.
[2022/01/04 15:58:00] fatal: Could not read from remote repository.
[2022/01/04 15:58:00]
[2022/01/04 15:58:00] Please make sure you have the correct access rights
[2022/01/04 15:58:00] and the repository exists.
其实“swimlane”依赖,不是go模块项目,已经下载好了。
[2022/01/04 15:57:39] go: downloading golang.***.com/kit/swimlane v0.0.1
[2022/01/04 15:57:39] get "golang.***.com/kit/swimlane": found meta tag vcs.metaImport{Prefix:"golang.***.com/kit/swimlane", VCS:"git", RepoRoot:"git+ssh://git@git.***.com/kit/swimlane"} at //golang.***.com/kit/swimlane?go-get=1
但是,由于某种原因我没有弄清楚,似乎是“/kafkax/kafka_consumer.go:9:2”导致它运行“git ls-remote -q origin”以获取远程引用可用于“泳道”。
我使用git ls-remote --get-url origin 来获取原始网址,即“http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.***.com/finance/order-center.git”。 “finance/order-center.git”是 gitlab 管道构建失败的确切项目,但不是“swimlane”的起源。
我正在寻找一种方法来使我的管道成功运行。非常感谢您分享您对此问题的意见或解决方案。
谢谢!!!
附:原来的 git 配置是:
[2022/01/04 15:57:18] Step 12/22 : RUN git config --list
[2022/01/04 15:57:18] ---> Running in 3170cf53e18e
[2022/01/04 15:57:18] url.http://git.***.com/.insteadof=git+ssh://git@git.***.com/
[2022/01/04 15:57:18] fetch.recursesubmodules=false
[2022/01/04 15:57:18] core.repositoryformatversion=0
[2022/01/04 15:57:18] core.filemode=true
[2022/01/04 15:57:18] core.bare=false
[2022/01/04 15:57:18] core.logallrefupdates=true
[2022/01/04 15:57:18] remote.origin.url=http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.***.com/finance/order-center.git
[2022/01/04 15:57:18] remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
[2022/01/04 15:57:18] branch.master.remote=origin
[2022/01/04 15:57:18] branch.master.merge=refs/heads/master
要使用 ssh 从私有仓库中获取代码,我运行
[2022/01/04 15:57:23] Step 20/22 : RUN git config --global --unset url.http://git.***.com/.insteadof
【问题讨论】:
-
我的本地 IDE 环境一切正常...
标签: go gitlab gitlab-ci go-modules