【发布时间】:2020-06-16 07:45:20
【问题描述】:
我正在尝试在 Jenkins 中创建一个构建。 我在 Manage Jenkins -> Global tools configuration 中创建了一个 mercurial 安装。
(我可以使用同一用户在命令行中克隆 repo)
但是我在控制台输出中有这个错误:
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: error: The requested URL returned error: 403 Forbidden while access 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
【问题讨论】:
-
您好,您存储在 jenkins 中的用户似乎没有对该特定 github 存储库的访问权限。但是,如果您需要更多帮助,您应该在项目配置中发布一些打印屏幕。如果您能找到任何有用的信息,请参阅此处:jenkins.io/solutions/github
-
我添加了一些图片,您需要更多信息吗?我正在使用 LDAP 登录 jenkins,但我正在使用 github 凭据构建作业。
-
一方面你说“我可以用同一个用户在[the]命令行中克隆 repo”然后你说“如果我尝试通过命令行克隆 repo 我有一个禁止错误 403”。你能解释一下吗?
-
ups 对不起@MrMister 我解决了这个问题。我可以我可以。我可以克隆。
标签: jenkins github jenkins-plugins