iliyan-trifonov / jenkins-ci-php

Docker image with Jenkins CI and full PHP configuration and tools
https://jenkins.iliyan-trifonov.com/
MIT License
28 stars 14 forks source link

Problem with file permission #4

Closed core23 closed 8 years ago

core23 commented 8 years ago

After creating a fresh container, I got an some exception in the log file

docker run -d --name jenkins-php -p 18080:8080 -e 'TIME_ZONE=Europe/Paris' -v /Users/XXX/jenkins:/var/lib/jenkins iliyan/jenkins-ci-php

INFO: Restart in 10 seconds
Jan 11, 2016 3:25:55 PM hudson.TcpSlaveAgentListener$ConnectionHandler run
INFO: Accepted connection #3 from /127.0.0.1:55080
Jan 11, 2016 3:25:58 PM hudson.TcpSlaveAgentListener$ConnectionHandler run
INFO: Accepted connection #4 from /127.0.0.1:55082
Running from: /usr/share/jenkins/jenkins.war
Feb 05, 2016 2:46:19 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Feb 05, 2016 2:46:19 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-winstone-2.9
Feb 05, 2016 2:46:21 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
Jenkins home directory: /var/lib/jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Feb 05, 2016 2:46:22 PM hudson.WebAppMain recordBootAttempt
WARNING: Failed to record boot attempts
java.io.FileNotFoundException: /var/lib/jenkins/failed-boot-attempts.txt (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at hudson.WebAppMain.recordBootAttempt(WebAppMain.java:295)
    at hudson.WebAppMain.contextInitialized(WebAppMain.java:131)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at winstone.Launcher.<init>(Launcher.java:156)
    at winstone.Launcher.main(Launcher.java:356)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at Main._main(Main.java:293)
    at Main.main(Main.java:98)

Feb 05, 2016 2:46:22 PM hudson.WebAppMain contextInitialized
SEVERE: Failed to initialize Jenkins
java.lang.NullPointerException
    at com.trilead.ssh2.util.IOUtils.closeQuietly(IOUtils.java:12)
    at hudson.WebAppMain.recordBootAttempt(WebAppMain.java:300)
    at hudson.WebAppMain.contextInitialized(WebAppMain.java:131)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at winstone.Launcher.<init>(Launcher.java:156)
    at winstone.Launcher.main(Launcher.java:356)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at Main._main(Main.java:293)
    at Main.main(Main.java:98)

Feb 05, 2016 2:46:22 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Failed startup of context w.{,file:/var/cache/jenkins/war/},/var/cache/jenkins/war
java.lang.NullPointerException
    at com.trilead.ssh2.util.IOUtils.closeQuietly(IOUtils.java:12)
    at hudson.WebAppMain.recordBootAttempt(WebAppMain.java:300)
    at hudson.WebAppMain.contextInitialized(WebAppMain.java:131)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at winstone.Launcher.<init>(Launcher.java:156)
    at winstone.Launcher.main(Launcher.java:356)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at Main._main(Main.java:293)
    at Main.main(Main.java:98)

Looks like there is an issue with the file permission for the home directory

$ ls -la /var/lib
drwxr-xr-x  1    1000 staff     68 Feb  5 13:46 jenkins
iliyan-trifonov commented 8 years ago

Hello @core23 ! Sorry for not being around for so long! Is this one still an issue? I try to rebuild the docker image often enough to keep the versions inside current which may introduce or repair bugs with the installation inside. If you want clone this repo and/or submit a PR here with a fix. Thanks!