PipelineThe assembly line passesgitpullJenkinsfilereport an error error: RPC failed; result=22, HTTP code = 404
In the study of shared libraries when using git pull jenkinsfile, reported an error in the troubleshooting gitlab service status, network communications, firewall rules, and Jenkins credentials can be used normally, and finally found when in theURL
Missing from fill in.git
The ending is caused by knowing that in GitLab or GitHub, it is common to use repository URLs to pull code, for example:
http://12.12.1.171/root/
The URL suffix of the.git
This is necessary for Git, especially if the server needs to recognize it as a Git repository. There are several reasons for this:
-
Server path resolution:: Belt
.git
The URL suffix is usually used to instruct the server that the path is a Git repository. If the.git
, the server may not be able to process the request correctly, resulting in the404
error, as it may interpret it as a regular web request rather than a repository pull request. -
standardized: Although in some cases, Git servers may tolerate the omission of the
.git
, but for compatibility and to ensure correctness, it is recommended to always use the.git
Suffix.
So, write less.git
suffix will cause Jenkins or other Git clients to report an error if they can't find the path when trying to fetch the repository from the server. TheRepository URL
Supplementary in the field.git
to solve this problem.
Started by user jenkinsjanitors
: Command "git fetch --tags --progress --prune origin +refs/heads/master:refs/remotes/origin/master" returned status code 128:
stdout:
stderr: error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly
at PluginClassLoader for git-client//(:2846)
at PluginClassLoader for git-client//(:2185)
at PluginClassLoader for git-client//$(:635)
at PluginClassLoader for git//$(:406)
at PluginClassLoader for scm-api//
(:219)
at PluginClassLoader for workflow-cps//(:126)
at PluginClassLoader for workflow-cps//(:73)
at PluginClassLoader for workflow-job//(:311)
at (:101)
at (:446)
Finished: FAILURE