java.nio.file.AccessDeniedException:/var/lib/jenkins/config.xml

时间:2018-01-17 09:43:04

标签: jenkins

我的Jenkins在8080端口运行,服务已启动并运行但在访问主页时出现以下错误:

java.nio.file.AccessDeniedException: /var/lib/jenkins/config.xml
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
    at java.nio.file.Files.newByteChannel(Files.java:361)
    at java.nio.file.Files.newByteChannel(Files.java:407)
    at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
    at java.nio.file.Files.newInputStream(Files.java:152)
    at hudson.XmlFile.unmarshal(XmlFile.java:165)
    at jenkins.model.Jenkins.loadConfig(Jenkins.java:3063)
    at jenkins.model.Jenkins.access$1200(Jenkins.java:304)
    at jenkins.model.Jenkins$14.run(Jenkins.java:3081)
    at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$5.runTask(Jenkins.java:1065)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    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:269)
    at jenkins.InitReactorRunner.run(InitReactorRunner.java:47)
    at jenkins.model.Jenkins.executeReactor(Jenkins.java:1099)
    at jenkins.model.Jenkins.<init>(Jenkins.java:904)
    at hudson.model.Hudson.<init>(Hudson.java:86)
    at hudson.model.Hudson.<init>(Hudson.java:82)
    at hudson.WebAppMain$3.run(WebAppMain.java:233)
Caused: hudson.util.HudsonFailedToLoad
    at hudson.WebAppMain$3.run(WebAppMain.java:250)

有人可以建议我在这里需要做些什么吗?

1 个答案:

答案 0 :(得分:0)

最可疑的原因是您没有将数据写入该文件的权限,可能只有读取权限。打开终端并输入sudo chown $(whoami) /var/lib/jenkins/config.xml

此答案是在部分提及与Android权限问题有关的答案时给出的,其中唯一起作用的是changing ownership of the SDK dir,这是用户Eytan Manor提供的解决方案。

如果您需要使用sudo chown -R $(whoami) /var/lib/jenkins而不是仅仅对该文件的完全访问权限,则可能需要为整个文件夹设置权限。