没有不值得去解决的问题,也没有不值得去学习的技术!

Analyzing and Resolving the “Failed to Connect to Repository” Error in Jenkins

After configuring it in Jenkins, an error occurred: repository 'https://gitlab.chinamcloud.com/pcs/pcs_api.git/' not found

1. Reference: Adjusting a project’s group and name in GitLab.

2. After configuring it in Jenkins, an error occurred: repository ‘https://gitlab.chinamcloud.com/pcs/pcs_api.git/’ not found, as shown in Figure 1.

After configuring it in Jenkins, an error occurred: repository 'https://gitlab.chinamcloud.com/pcs/pcs_api.git/' not found
Figure 1
Plaintext

Failed to connect to repository : Command "git ls-remote -h https://gitlab.chinamcloud.com/pcs/pcs_api.git HEAD" returned status code 128:
stdout:
stderr: fatal: repository 'https://gitlab.chinamcloud.com/pcs/pcs_api.git/' not found

3. I checked the user list under the php group and found the user JenkinsIntegration, as shown in Figure 2.

Checking the user list under the php group, the user JenkinsIntegration exists
Figure 2

4. I added the user JenkinsIntegration to the user list under the pcs group with the role of Guest, as shown in Figure 3.

Adding the user JenkinsIntegration to the user list under the pcs group with the role of Guest
Figure 3

5. After configuring it in Jenkins, an error occurred: unable to access ‘https://gitlab.chinamcloud.com/pcs/pcs_api.git/’: The requested URL returned error: 403

Plaintext

Failed to connect to repository : Command "git ls-remote -h https://gitlab.chinamcloud.com/pcs/pcs_api.git HEAD" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://gitlab.chinamcloud.com/pcs/pcs_api.git/': The requested URL returned error: 403

6. I changed the role of the user JenkinsIntegration in the user list under the pcs group to Developer, as shown in Figure 4.

Changing the role of the user JenkinsIntegration in the user list under the pcs group to Developer
Figure 4

7. After configuring it in Jenkins, the error no longer occurred, but the build still failed, as shown in Figure 5.

After configuring it in Jenkins, the error no longer occurred, but the build still failed.
Figure 5

8. After contacting the operations team to create pcs_api on the Registry, the build succeeded, as shown in Figure 6.

After contacting the operations team to create pcs_api on the Registry, the build succeeded.
Figure 6

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系