先日、 Jenkins でいつも通り Git リポジトリをクローンしようとしていました。そのときなんと、容量が大きすぎてタイムアウトしてビルドが通りませんでした。
これの解決方法を書いていきます。
Gitのリポジトリがクローンできない問題
タイムアウトがデフォルトで10分に設定されていて、
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from hoge@example.com/hello.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:806)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
at hudson.scm.SCM.checkout(SCM.java:496)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress hoge@example.com/hello.git +refs/heads/*:refs/remotes/origin/*" returned status code 143:
のようなエラーが発生してしまいます。
解決方法
Additional Behaviors
を追加します。 Advanced clone behaviors
を選択して、
Timeout (in minutes) for clone and fetch operations
でタイムアウト時間を分単位で大きめに設定しておきます。とりあえず、 30
とかに設定しておけばよいかと思います。
これで勝つる。このあと、きちーっとビルドが通るか確認して完了です。
この記事を読んだあとに
- 書いた人のツイッター – Follow me!
- 『売上を3年連続20%成長させた18の秘訣』
- 運営しているアクションゲーム