LoginSignup
3
0

More than 3 years have passed since last update.

Jenkinsのビルドが突然java.net.MalformedURLExceptionで落ちるようになった

Last updated at Posted at 2020-07-01

はじめに

JenkinsでGoで書かれたソースをビルドしているのですが、そのジョブが突然落ちるようになったので解決策を記載します。

この問題は、記載している時点(2020/07/01)で既に修正済み(リリース待ち)の状態です。
リリースまでの一時しのぎとして対応していますのでご注意ください。

現在は修正済みです。

エラー内容

昨日(2020/06/30)あたりから、突然Jenkinsが以下の例外を吐いて落ちるようになりました。

java.net.MalformedURLException: no protocol: /dl/go1.11.2.linux-amd64.tar.gz
    at java.net.URL.<init>(URL.java:593)
    at java.net.URL.<init>(URL.java:490)
    at java.net.URL.<init>(URL.java:439)
    at org.jenkinsci.plugins.golang.GolangInstaller.performInstallation(GolangInstaller.java:57)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:69)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
    at org.jenkinsci.plugins.golang.GolangInstallation.forNode(GolangInstallation.java:44)
    at org.jenkinsci.plugins.golang.GolangInstallation.forNode(GolangInstallation.java:22)
    at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:152)
    at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:133)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(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)
    at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

ググってみると以下のページがヒット。

どうやらJenkins内でGoをインストールする際のURLが正しくないようです。
この修正は修正は完了していてリリース待ちの状態とのこと。とはいえ、実装したソースをすぐデプロイして確認したかったので、リリースまでの間取りあえず動く状態にします。

Jenkinsの管理 → Global Tool Configuration と遷移し、Goの設定を開きます。(インストール済みGo...のボタンをクリックします)
私は以下のようにGoを自動インストールする設定にしていたので、この自動インストール時に落ちていそうです。

スクリーンショット 2020-07-01 11.03.37.png

よって、自動インストールを停止して、すでにインストール済みのGoのディレクトリを指定する形にして対処しました。
プラグインによって自動ダウンロードされたものは、${JENKINS_HOME/tools/org.jenkinsci.plugins.golang.GolangInstallation配下にインストールされているのでそれを指定します。

スクリーンショット 2020-07-01 11.12.24.png

直近で他のバージョンのGoを新規インストールする予定はないのでこれで十分です。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0