Jenkins failing to auto install JDK when JENKINS_HOME is pointing to a newly created volume/filesystem

1,731 views
Skip to first unread message

Fábio Uechi

unread,
Nov 10, 2012, 11:22:13 AM11/10/12
to jenkins...@googlegroups.com
Hi,

I'm running Jenkins as a daemon on Amazon Linux (standalone on winstone). 
I changed JENKINS_HOME (/etc/sysconfig/jenkins) to point to "/jenkins" instead of "/var/lib/jenkins".
The "/jenkins" directory is a new mount based on an EBS volume attached (/dev/sda1) to the EC2 instance.
Everything seems to be working fine except for JDK auto installations. When Jenkins tries to execute the downloaded jdk.sh (i.e.  /jenkins/tools/JDK/jdk-1.6.24/jdk.sh ) I'm getting a "permission denied" error.
Other installers such as Mavens and Ants are working normally.

This is probably not "Jenkins fault" but I'd like to know if someone have seen that before.
When I change JENKINS_HOME back to the default everything works.

Any help is appreciated
Thanks in advance

Fábio

Fábio Uechi

unread,
Nov 10, 2012, 11:28:50 AM11/10/12
to jenkins...@googlegroups.com
Forgot to mention that JENKINS_HOME was pointing to an EXT4 filesystem created with: 

mke2fs -t ext4 -F /dev/vg0/jenkins

Dirk Weigenand

unread,
Nov 11, 2012, 2:37:59 PM11/11/12
to jenkins...@googlegroups.com
What does a 'ls -l /jenkins/tools/JDK/jdk-1.6.24/jdk.sh' say?

It should report the executable bits on i.e.:

-rwxr-xr-x 1 tomcat6 tomcat6

Replace tomcat6 with the respective group and user of your environment.

regards

Dirk

On 10.11.2012 17:22, Fábio Uechi wrote:
> Hi,
>
> I'm running Jenkins as a daemon on Amazon Linux (standalone on winstone).
> I changed JENKINS_HOME (/etc/sysconfig/jenkins) to point to "*/jenkins"*
> instead of "*/var/lib/jenkins".*
> The "*/jenkins*" directory is a new mount based on an EBS volume
> attached (/dev/sda1) to the EC2 instance.
> Everything seems to be working fine except for JDK auto installations.
> When Jenkins tries to execute the downloaded jdk.sh (i.e.
> /jenkins/tools/JDK/jdk-1.6.24/jdk.sh ) I'm getting a "*permission
> denied*" error.

Fábio Uechi

unread,
Nov 11, 2012, 5:00:02 PM11/11/12
to jenkins...@googlegroups.com
That's not the problem.
Executable privileges,user and group are all correct.
My instance was installed through "yum" which creates the user and group "jenkins"

Fábio Uechi

unread,
Nov 13, 2012, 12:26:59 PM11/13/12
to jenkins...@googlegroups.com
This is the exception I'm getting:


Building in workspace /jenkins/workspace/teste
Installing JDK jdk-6u34-oth-JPR
Downloading JDK from http://download.oracle.com/otn/java/jdk/6u34-b04/jdk-6u34-linux-x64.bin
Downloading 72036348bytes
Installing /jenkins/tools/JDK/1.6.34/jdk.sh
[1.6.34] $ /jenkins/tools/JDK/1.6.34/jdk.sh -noregister
FATAL: command execution failed
java.io.IOException: Cannot run program "/jenkins/tools/JDK/1.6.34/jdk.sh" (in directory "/jenkins/tools/JDK/1.6.34"): java.io.IOException: error=13, Permission denied
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
	at hudson.Proc$LocalProc.<init>(Proc.java:244)
	at hudson.Proc$LocalProc.<init>(Proc.java:216)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:763)
	at hudson.Launcher$ProcStarter.start(Launcher.java:346)
	at hudson.Launcher$ProcStarter.join(Launcher.java:353)
	at hudson.tools.JDKInstaller.install(JDKInstaller.java:185)
	at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:132)
	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:61)
	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107)
	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:203)
	at hudson.model.JDK.forNode(JDK.java:122)
	at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:311)
	at hudson.model.Run.getEnvironment(Run.java:1965)
	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:930)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:75)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
	at hudson.model.Build$BuildExecution.build(Build.java:199)
	at hudson.model.Build$BuildExecution.doRun(Build.java:160)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
	at hudson.model.Run.execute(Run.java:1516)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:236)
Caused by: java.io.IOException: java.io.IOException: error=13, Permission denied
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
	at java.lang.ProcessImpl.start(ProcessImpl.java:81)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
	... 25 more

Fábio Uechi

unread,
Nov 13, 2012, 1:57:29 PM11/13/12
to jenkins...@googlegroups.com
Found it! 
There was a problem in the fstab entry which was responsible for mounting the partition. 
I was using noexec instead of exec.
Just had to change this:

/dev/vg0/jenkins /jenkins ext4 defaults,auto,noatime,noexec 0 0

for this:

/dev/vg0/jenkins /jenkins ext4 defaults,auto,noatime,exec 0 0

Living and learning!
Thanks for everybody who tried to help!
Reply all
Reply to author
Forward
0 new messages