我最近设置了一个 gogs 服务器来连接 Jenkins(以前我们使用的是 SVN)。连接正常,但在从 41%-43% 左右的 gogs 服务器检索对象时构建失败(每个构建不同,但始终在该范围内)。
GOGS api是否设置了某种限制?以下是我得到的唯一错误输出。
Receiving objects: 41% (270082/645355), 2.68 GiB | 18.83 MiB/s
Receiving objects: 41% (270419/645355), 2.70 GiB | 18.96 MiB/s
Killed by signal 15.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:351)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:196)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:172)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:107)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:271)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
更新:我的詹金斯主人所在的服务器需要增加磁盘大小(我正在做的 android ROM 构建绝对是巨大的,并且将缓存填满到故障点)。我在我的设置中添加了另外 60GB 的空间并重新运行了我的构建。
正如 Jey 在评论中提到的,ssh 可能在其中发挥作用,所以我在 Jenkins 主服务器上的 sshd_config 中添加了以下几行,以满足长时间打开连接的需要:
ClientAliveInterval 120
ClientAliveCountMax 720
该构建确实比以前的尝试更进一步,但最终仍然失败,方式与以前相同:
Receiving objects: 55% (355794/645358), 3.51 GiB | 13.63 MiB/s
Receiving objects: 55% (359617/645358), 3.52 GiB | 13.75 MiB/s
Killed by signal 15.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1715)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:351)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:196)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:172)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:107)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:271)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
新更新:
进行更多测试(不要相信这是网络问题,但感谢您的评论)。我注意到该构建在 10 分钟后被杀死。通过查看其他有相同问题的人,我发现您可以通过高级选项来增加它。我已经这样做了,但是 10 分钟后它仍然失败。
新更新:
我附上了我的构建 config.xml 的副本,您可以在文件中看到超时已更新,但构建仍使用 10 分钟的默认超时限制。不知道我在这里错过了什么......
<?xml version='1.1' encoding='UTF-8'?>
<flow-definition plugin="[email protected]">
<actions/>
<description>Android ROM Build</description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.buildblocker.BuildBlockerProperty plugin="[email protected]">
<useBuildBlocker>false</useBuildBlocker>
<blockLevel>GLOBAL</blockLevel>
<scanQueueFor>DISABLED</scanQueueFor>
<blockingJobs></blockingJobs>
</hudson.plugins.buildblocker.BuildBlockerProperty>
<org.jenkinsci.plugins.gogs.GogsProjectProperty plugin="[email protected]">
<gogsSecret>XXXXXXXXXXXXX</gogsSecret>
<gogsUsePayload>false</gogsUsePayload>
</org.jenkinsci.plugins.gogs.GogsProjectProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="[email protected]">
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>[email protected]:git-admin/SF-Firefly-RK3399.git</url>
<credentialsId>XXXXXXXXXXXXXX</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/fresh_after_opersys_patches</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.CloneOption>
<shallow>true</shallow>
<noTags>false</noTags>
<reference>[email protected]:git-admin/SF-Firefly-RK3399.git</reference>
<timeout>240</timeout>
<depth>1</depth>
<honorRefspec>true</honorRefspec>
</hudson.plugins.git.extensions.impl.CloneOption>
<hudson.plugins.git.extensions.impl.CheckoutOption>
<timeout>240</timeout>
</hudson.plugins.git.extensions.impl.CheckoutOption>
</extensions>
</scm>
<scriptPath>Jenkinsfile</scriptPath>
<lightweight>true</lightweight>
</definition>
<triggers/>
<disabled>false</disabled>
</flow-definition>
好的,所以在我的桌子上敲了几个小时后,我终于弄明白了。问题是管道构建上的轻量级结帐标志。一旦它被禁用(如下面的屏幕截图所示,10 分钟的超时时间会增加到我在高级克隆/获取行为中设置的值。
之前遇到过类似的问题,但我的情况是网络问题,无法通过 jenkins 从 git 下载大文件,在下载一定数量的数据后自动断开连接
我建议检查网络连接、代理设置等...