git - Jenkins 错误:克隆远程 repo 'origin' 时出错
问题描述
我正在尝试使用 Jenkins 的第一步,但没有成功管理第一个管道测试。我正在为 Kubernetes 使用最新的 Jenkins helm chart。
我正在尝试运行这个简单的管道:
pipeline {
agent any
stages {
stage('Test') {
agent {
docker {
image 'php'
}
}
steps {
sh 'php --v'
}
}
}
}
源代码托管在 GitHub 上,存储库似乎连接正确。我的管道总是失败:
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://github.com/yoghurt1001/WebsiteInfo.git
> git init /home/jenkins/workspace/WebsiteInfo_master # timeout=10
Fetching upstream changes from https://github.com/yoghurt1001/WebsiteInfo.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials GitHub Access Token
> git fetch --no-tags --progress https://github.com/yoghurt1001/WebsiteInfo.git +refs/heads/master:refs/remotes/origin/master
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --no-tags --progress https://github.com/yoghurt1001/WebsiteInfo.git +refs/heads/master:refs/remotes/origin/master" returned status code 137:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:181)
at hudson.remoting.UserRequest.perform(UserRequest.java:52)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
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 hudson.remoting.Engine$1$1.run(Engine.java:98)
at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 10.244.2.240/10.244.2.240:51982
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:389)
at hudson.remoting.Channel.call(Channel.java:955)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy112.execute(Unknown Source)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:90)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:77)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
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)
... 1 more
Error cloning remote repo 'origin'
在此之前詹金斯做了一个使用 git 成功的步骤: 有没有人知道可能出了什么问题?我还在一些 Bitbucket Server 存储库上尝试了相同的管道,结果相同。
菲利克斯
解决方案
检查这是否与问题 JENKINS-50132 有关
将内存增加到 1024 Mi 和 CPU 到 500m 后问题得到解决,之前它使用 Kubernetes 集群的默认设置,即 256Mi 和 200m。
推荐阅读
- java - 数独求解器未正确求解
- java - @Bean 和 Spring 中的 Autowired 有什么区别?
- ajax - 在 laravel 5.7.14 中使用命名空间时出现此错误
- gradle - Android Gradle 插件:将 NDK 可执行文件打包到 APK 中
- javascript - 当我使用模板文字并运行代码时,结果未定义
- python - 涉及序列的任务需要多少个 RNN 单元?
- testing - 如何在jmeter中每25分钟运行一个线程
- javascript - Reactjs Facebook 登录库的问题 - 使 componentClicked 函数异步
- highcharts - Highstock 工具提示“标签”未呈现
- r - R/闪亮的数据框列