2

I have my Jenkins running on 8080 port and the service is up and running but while accessing the home page I am getting the below error :

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)

Can anyone please suggest me what needs to be done here?

1 Answers1

0

The most suspected reason for this would be that you do not have permissions to write data to that file, probably only read. Open up your terminal and write sudo chown $(whoami) /var/lib/jenkins/config.xml.

This answer is given in part while refering to this answer relating to Android permission issues, where the only thing that worked was changing ownership of the SDK dir, solution as given by user Eytan Manor.

You might want to set permissions for that whole folder if you need full access to more than just that file using sudo chown -R $(whoami) /var/lib/jenkins.

Wylie
  • 350
  • 3
  • 12