![Jenkins 构建失败,错误输出有限](https://linux22.com/image/724329/Jenkins%20%E6%9E%84%E5%BB%BA%E5%A4%B1%E8%B4%A5%EF%BC%8C%E9%94%99%E8%AF%AF%E8%BE%93%E5%87%BA%E6%9C%89%E9%99%90.png)
我最近设置了一个 gogs 服务器来连接 Jenkins(之前我们使用 SVN)。连接正常,但从 gogs 服务器检索对象时构建失败,大约在 41%-43%(每次构建都不同,但始终在该范围内)。
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
更新:我的 jenkins master 所在的服务器需要增加磁盘大小(我正在构建的 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>
答案1
答案2
之前遇到过类似的问题,但我的情况是网络问题,无法通过 jenkins 从 git 下载大文件,下载一定量的数据后会自动断开连接
我建议检查网络连接、代理设置等......