Friday, September 26, 2014

Jenkins service failed to startup as service

As part of the AWS instance reboot, on one of the machines jenkins service did not come up. The /var/log/jenkins/jenkins.log had the below permissions related error:-

**************
Sep 27, 2014 2:08:49 AM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /var/cache/jenkins/war/META-INF/MANIFEST.MF (Permission denied)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:277)
        at winstone.HostConfiguration.<init>(HostConfiguration.java:81)
        at winstone.HostGroup.initHost(HostGroup.java:66)
        at winstone.HostGroup.<init>(HostGroup.java:45)
        at winstone.Launcher.<init>(Launcher.java:143)
        at winstone.Launcher.main(Launcher.java:354)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at Main._main(Main.java:293)
        at Main.main(Main.java:98)
**************

On checking the /var/cache folder, the user and group owner was set to a different user than what jenkins was trying to run as in the /etc/init.d/jenkins script. So had to change the folder permissions using in /var/cache/jenkins folder

$sudo chown -R <jenkins_user><jenkins_group> /var/cache/jenkins

and then restart the jenkins service

$sudo service jenkins restart

No comments:

Post a Comment