Git
詹金斯建構失敗,錯誤輸出有限
我最近設置了一個 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="workflow-job@2.17"> <actions/> <description>Android ROM Build</description> <keepDependencies>false</keepDependencies> <properties> <hudson.plugins.buildblocker.BuildBlockerProperty plugin="build-blocker-plugin@1.7.3"> <useBuildBlocker>false</useBuildBlocker> <blockLevel>GLOBAL</blockLevel> <scanQueueFor>DISABLED</scanQueueFor> <blockingJobs></blockingJobs> </hudson.plugins.buildblocker.BuildBlockerProperty> <org.jenkinsci.plugins.gogs.GogsProjectProperty plugin="gogs-webhook@1.0.14"> <gogsSecret>XXXXXXXXXXXXX</gogsSecret> <gogsUsePayload>false</gogsUsePayload> </org.jenkinsci.plugins.gogs.GogsProjectProperty> </properties> <definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.47"> <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.1"> <configVersion>2</configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <url>gogs@xxx-xxx.xxx.com: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>gogs@xxx-xxx.xxx.com: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 下載大文件,在下載一定數量的數據後自動斷開連接
我建議檢查網路連接、代理設置等…