Error in Jenkins: Failed to connect to repository command git ls-remote Returned status code 128 analysis solution
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
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
4. In the user list under the group PCS, add users: jenkinsintegration, the identity is: guest, as shown in 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
7. After configuring in jenkins, no error is reported, but the build still fails. as shown in 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





