[JIRA] (JENKINS-60288) Installator is broken on Alpine

11 views
Skip to first unread message

bochenski.kuba+jenkins@gmail.com (JIRA)

unread,
Nov 26, 2019, 11:27:03 AM11/26/19
to jenkinsc...@googlegroups.com
Jakub Bochenski created an issue
 
Jenkins / Bug JENKINS-60288
Installator is broken on Alpine
Issue Type: Bug Bug
Assignee: Mads Mohr Christensen
Components: adoptopenjdk-plugin
Created: 2019-11-26 16:26
Priority: Major Major
Reporter: Jakub Bochenski

The installer does not throw an error but the resulting installation is not usable.
Sample output from trying to run this on a jenkinsci/slave: alpine with docker-plugin

Running as SYSTEM
[EnvInject] - Loading node environment variables.
Installing AdoptOpenJDK to /home/jenkins/tools/hudson.model.JDK/jdkadopt
ERROR: Failed to download file:/var/lib/jenkins/caches/adoptopenjdk/LINUX/amd64/jdk-11.0.5+10.zip from agent; will retry from master
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to docker-006z72dcdzrtj
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:957)
		at hudson.FilePath.act(FilePath.java:1070)
		at hudson.FilePath.act(FilePath.java:1059)
		at hudson.FilePath.installIfNecessaryFrom(FilePath.java:913)
		at hudson.FilePath.installIfNecessaryFrom(FilePath.java:846)
		at io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller.performInstallation(AdoptOpenJDKInstaller.java:121)
		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 hudson.model.JDK.forNode(JDK.java:147)
		at org.jenkinsci.plugins.envinject.util.RunHelper.getJDKVariables(RunHelper.java:111)
		at org.jenkinsci.plugins.envinject.util.RunHelper.getBuildVariables(RunHelper.java:134)
		at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironmentWithoutJobPropertyObject(EnvInjectListener.java:233)
		at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:49)
		at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:542)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:462)
		at hudson.model.Run.execute(Run.java:1818)
		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
		at hudson.model.ResourceController.execute(ResourceController.java:97)
		at hudson.model.Executor.run(Executor.java:429)
java.io.FileNotFoundException: /var/lib/jenkins/caches/adoptopenjdk/LINUX/amd64/jdk-11.0.5+10.zip (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:93)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
	at java.net.URL.openStream(URL.java:1045)
	at hudson.FilePath$Unpack.invoke(FilePath.java:949)
	at hudson.FilePath$Unpack.invoke(FilePath.java:943)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3050)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	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)
Building remotely on docker-006z72dcdzrtj on helpsbslave01.fi.f-secure.com (docker) (any) in workspace /home/jenkins/workspace/adopt-test
Installing AdoptOpenJDK to /home/jenkins/tools/hudson.model.JDK/jdkadopt
ERROR: Failed to download file:/var/lib/jenkins/caches/adoptopenjdk/LINUX/amd64/jdk-11.0.5+10.zip from agent; will retry from master
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to docker-006z72dcdzrtj
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:957)
		at hudson.FilePath.act(FilePath.java:1070)
		at hudson.FilePath.act(FilePath.java:1059)
		at hudson.FilePath.installIfNecessaryFrom(FilePath.java:913)
		at hudson.FilePath.installIfNecessaryFrom(FilePath.java:846)
		at io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller.performInstallation(AdoptOpenJDKInstaller.java:121)
		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 hudson.model.JDK.forNode(JDK.java:147)
		at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:341)
		at hudson.model.Run.getEnvironment(Run.java:2374)
		at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:864)
		at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:102)
		at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
		at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
		at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
		at hudson.model.Build$BuildExecution.build(Build.java:206)
		at hudson.model.Build$BuildExecution.doRun(Build.java:163)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
		at hudson.model.Run.execute(Run.java:1818)
		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
		at hudson.model.ResourceController.execute(ResourceController.java:97)
		at hudson.model.Executor.run(Executor.java:429)
java.io.FileNotFoundException: /var/lib/jenkins/caches/adoptopenjdk/LINUX/amd64/jdk-11.0.5+10.zip (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:93)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
	at java.net.URL.openStream(URL.java:1045)
	at hudson.FilePath$Unpack.invoke(FilePath.java:949)
	at hudson.FilePath$Unpack.invoke(FilePath.java:943)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3050)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	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)
[adopt-test] $ /bin/sh -xe /tmp/jenkins1014781285759488702.sh
+ env
PATH=/home/jenkins/tools/hudson.model.JDK/jdkadopt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
JAVA_HOME=/home/jenkins/tools/hudson.model.JDK/jdkadopt
+ java -version
Picked up JAVA_TOOL_OPTIONS: -XX:+StartAttachListener -Dhttps.proxyHost=proxy.eu-west-1.ele-df.fsapi.com -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.*|[::1]|*.f-secure.com
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (IcedTea 3.12.0) (Alpine 8.212.04-r0)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
+ javac -version
Picked up JAVA_TOOL_OPTIONS: -XX:+StartAttachListener -Dhttps.proxyHost=proxy.eu-west-1.ele-df.fsapi.com -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.*|[::1]|*.f-secure.com
javac 1.8.0_212
+ which java
/usr/bin/java
+ which javac
/usr/lib/jvm/java-1.8-openjdk/bin/javac
+ /home/jenkins/tools/hudson.model.JDK/jdkadopt/bin/java -version
/tmp/jenkins1014781285759488702.sh: line 8: /home/jenkins/tools/hudson.model.JDK/jdkadopt/bin/java: not found
Build step 'Execute shell' marked build as failure

TL;DR $JAVA_HOME/bin/java is not executable.

When I switch to a debian-based jenkinsci/slave it works as expected.

If it cannot be made to work I would ask that it at least fails the installation step instead of allowing the build to proceed. That would save time debugging the issue

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

bochenski.kuba+jenkins@gmail.com (JIRA)

unread,
Nov 26, 2019, 11:27:04 AM11/26/19
to jenkinsc...@googlegroups.com
Jakub Bochenski updated an issue
Change By: Jakub Bochenski
The installer does not throw an error but the resulting installation is not usable.
Sample output from trying to run this on a {{jenkinsci/slave: alpine}} with the docker-plugin
{code}
Picked up JAVA_TOOL_OPTIONS: -XX:+StartAttachListener -Dhttps.proxyHost=proxy.eu-west-1. ele-df acme . fsapi. com -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.*|[::1]|*. f-secure acme .com

openjdk version "1.8.0_212"
OpenJDK Runtime Environment (IcedTea 3.12.0) (Alpine 8.212.04-r0)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
+ javac -version
Picked up JAVA_TOOL_OPTIONS: -XX:+StartAttachListener -Dhttps.proxyHost=proxy.eu-west-1. ele-df acme . fsapi. com -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.*|[::1]|*. f-secure acme .com

javac 1.8.0_212
+ which java
/usr/bin/java
+ which javac
/usr/lib/jvm/java-1.8-openjdk/bin/javac
+ /home/jenkins/tools/hudson.model.JDK/jdkadopt/bin/java -version
/tmp/jenkins1014781285759488702.sh: line 8: /home/jenkins/tools/hudson.model.JDK/jdkadopt/bin/java: not found
Build step 'Execute shell' marked build as failure{code}


TL;DR {{$JAVA_HOME/bin/java}} is not executable.

When I switch to a debian-based {{jenkinsci/slave}} it works as expected.

If it cannot be made to work I would ask that it at least fails the installation step instead of allowing the build to proceed. That would save time debugging the issue

bochenski.kuba+jenkins@gmail.com (JIRA)

unread,
Nov 26, 2019, 11:29:02 AM11/26/19
to jenkinsc...@googlegroups.com
Picked up JAVA_TOOL_OPTIONS: -XX:+StartAttachListener -Dhttps.proxyHost=proxy.eu-west-1.acme.com -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.*|[::1]|*.acme.com

openjdk version "1.8.0_212"
OpenJDK Runtime Environment (IcedTea 3.12.0) (Alpine 8.212.04-r0)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
+ javac -version
Picked up JAVA_TOOL_OPTIONS: -XX:+StartAttachListener -Dhttps.proxyHost=proxy.eu-west-1.acme.com -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|127.*|[::1]|*.acme.com

javac 1.8.0_212
+ which java
/usr/bin/java
+ which javac
/usr/lib/jvm/java-1.8-openjdk/bin/javac
+ /home/jenkins/tools/hudson.model.JDK/jdkadopt/bin/java -version
/tmp/jenkins1014781285759488702.sh: line 8: /home/jenkins/tools/hudson.model.JDK/jdkadopt/bin/java: not found
Build step 'Execute shell' marked build as failure{code}

TL;DR {{$JAVA_HOME/bin/java}} is not executable.

When I switch to a debian-based {{jenkinsci/slave}} it works as expected.

If it cannot be made to work I would ask that it at least fails the installation step instead of allowing the build to proceed. That would save time debugging the issue .

I tried this with multiple versions, notably {{jdk8u232-b09}} which is used in the official docker image https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/8/jdk/alpine/Dockerfile.hotspot.releases.full

bochenski.kuba+jenkins@gmail.com (JIRA)

unread,
Nov 26, 2019, 11:32:02 AM11/26/19
to jenkinsc...@googlegroups.com
Jakub Bochenski updated an issue
The installer does not throw an error but the resulting installation is not usable unusable .

hr.mohr@gmail.com (JIRA)

unread,
May 3, 2020, 4:54:05 PM5/3/20
to jenkinsc...@googlegroups.com
Mads Mohr Christensen commented on Bug JENKINS-60288
 
Re: Installator is broken on Alpine

It's generally best practice to build docker images that contain the build tools needed instead of installing tools on each run. This will save time and remove potential error sources.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

bochenski.kuba+jenkins@gmail.com (JIRA)

unread,
May 4, 2020, 6:52:02 AM5/4/20
to jenkinsc...@googlegroups.com

That is not practical if you need to support builds using different JDK versions.

Replying "don't use the plugin" to a bug request isn't very helpful.

hr.mohr@gmail.com (JIRA)

unread,
May 4, 2020, 5:52:03 PM5/4/20
to jenkinsc...@googlegroups.com

Please note that I didn't reject this issue and I still might try to fix it or accept PRs that fixes it.

https://github.com/jenkinsci/adoptopenjdk-plugin#usage-recommendations

Reply all
Reply to author
Forward
0 new messages