我在Ubuntu上从apt命令行更新了Jenkins,我在更新后立即升级了jenkins升级我得到了这个:
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)
答案 0 :(得分:6)
刚刚找到了解决方案。更新后,Jenkins的主目录中有ubuntu
和jenkins
所有者的文件混乱。我刚刚将所有人的所有权都改回jenkins
:
sudo chown -R jenkins:jenkins $JENKINS_HOME
答案 1 :(得分:3)
当$JENKINS_HOME/jobs
目录具有不正确的权限或所有权时,我经历了这种情况。在我的特定情况下,我已将作业同步到测试服务器,却忘记更新文件所有权以匹配Jenkins在测试系统上运行的用户。将所有权更改为正确的用户即可解决此问题。
可能发生此错误的原因有很多,但我首先要检查$JENKINS_HOME
下的文件和目录,以验证运行Jenkins进程的用户可以读写它们。