我正在尝试在詹金斯创建一个版本。 我在Manage Jenkins->全局工具配置中创建了一个临时安装。
(我可以使用相同的用户在命令行中克隆存储库)
但是我在控制台输出中有此错误:
timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://github.com/libpath.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:909) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1131) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1167) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.lambda$doRetrieve$1(SCMSourceRetriever.java:157) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrySCMOperation(SCMSourceRetriever.java:107) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.doRetrieve(SCMSourceRetriever.java:156) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:96) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157) at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:207) at org.jenkinsci.plugins.workflow.libs.LibraryStep$Execution.run(LibraryStep.java:156) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:359) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --no-tags --progress https://github.com/libpath.git
+ refs / heads / master:refs / remotes / origin / master“返回状态码128: 标准输出: stderr:错误:请求的URL返回错误:403访问https://github.com/libpath/refs时被禁止
fatal: HTTP request failed at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2044) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:907) ... 18 more ERROR: Error fetching remote repo 'origin' [Pipeline] End of Pipeline GitHub has been notified of this commit’s build result ERROR: Maximum checkout retry attempts reached, aborting Finished: FAILURE
这是我的工作配置: Job config image
也定义了一些库: libraries image
答案 0 :(得分:0)
最后,我修复了此错误。 在jenkins中安装的git版本太旧了。 我已经更新了版本,现在错误已解决。
如果出现此错误,请检查您的GIT版本。