Error in Jenkins: Failed to connect to repository command git ls-remote Returned status code 128 analysis solution

在 Jenkins 中配置后,报错:repository 'https://gitlab.chinamcloud.com/pcs/pcs_api.git/' not found

1. Reference website: https://www.shuijingwanwq.com/en/2020/04/09/9889/ , adjust the group and name of the project in gitlab.

2. After configuring in jenkins, an error is reported: repositoryhttps://gitlab.chinamcloud.com/pcs/pcs_api.git/not found, as shown in Figure 1

在 Jenkins 中配置后,报错:repository 'https://gitlab.chinamcloud.com/pcs/pcs_api.git/' not found
Figure 1
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: repositoryhttps://gitlab.chinamcloud.com/pcs/pcs_api.git/Not found

3. The user list under the analysis group PHP, there is a user: JenkinsIntegration, as shown in Figure 2

分析组 php 下的用户列表,存在用户:JenkinsIntegration
Figure 2

4. In the user list under the group PCS, add users: jenkinsintegration, the identity is: guest, as shown in Figure 3

在组 pcs 下的用户列表,添加用户:JenkinsIntegration,身份为:Guest
Figure 3

5. After configuring in jenkins, an error is reported: Unable to accesshttps://gitlab.chinamcloud.com/pcs/pcs_api.git/: The requested URL returned error: 403

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 accesshttps://gitlab.chinamcloud.com/pcs/pcs_api.git/: The requested URL returned error: 403

6. In the user list under the group PCS, modify the user: JenkinsIntegration, the identity is: Developer, as shown in Figure 4

在组 pcs 下的用户列表,修改用户:JenkinsIntegration,身份为:Developer
Figure 4

7. After configuring in jenkins, no error is reported, but the build still fails. as shown in Figure 5

在 Jenkins 中配置后,未再报错,但是仍然构建失败。
Figure 5

8. After contacting the operation and maintenance to create a new pcs_api on registry, the build is successful. as shown in Figure 6

联系运维在 Registry 上新建 pcs_api 后,构建成功。
Figure 6

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.