Jenkins throwing error: jenkins.model.InvalidBuildsDir: ${ITEM_ROOTDIR}/builds does not exist and probably cannot be created

chandra picture chandra · Jun 11, 2018 · Viewed 9.7k times · Source

i updated Jenkins from apt command line on Ubuntu,i did sudo apt upgrade jenkins immediately after update i am getting this:

jenkins.model.InvalidBuildsDir: ${ITEM_ROOTDIR}/builds does not exist and 
probably cannot be created
at jenkins.model.Jenkins.checkRawBuildsDir(Jenkins.java:3085)
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3009)
Caused: java.io.IOException
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3012)
at jenkins.model.Jenkins.access$1200(Jenkins.java:304)
at jenkins.model.Jenkins$14.run(Jenkins.java:3104)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run 
(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
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)
Caused: org.jvnet.hudson.reactor.ReactorException
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:48)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:1102)
at jenkins.model.Jenkins.<init>(Jenkins.java:904)
at hudson.model.Hudson.<init>(Hudson.java:85)
at hudson.model.Hudson.<init>(Hudson.java:81)
at hudson.WebAppMain$3.run(WebAppMain.java:233)
Caused: hudson.util.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:250)

Answer

Sergey Yarotskiy picture Sergey Yarotskiy · Nov 1, 2018

Just found a solution. After update, Jenkins home dir had a mess of files with ubuntu and jenkins owners. I just changed ownership for all of them back to jenkins:

sudo chown -R jenkins:jenkins $JENKINS_HOME