Omprakash
Omprakash

Reputation: 86

Too many open files error! Can't open Jenkins after installing many plugins

I searched the previous threads but did not solve my problems. I am using Ubuntu.

The Problem is this:

Error java.nio.file.FileSystemException: /var/lib/jenkins/config.xml: Too many open files at

sun.nio.fs.UnixException.translateToIOException(UnixException.java:103) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:114) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:119) at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:226) at java.nio.file.Files.newByteChannel(Files.java:372) at java.nio.file.Files.newByteChannel(Files.java:418) at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:395) at java.nio.file.Files.newInputStream(Files.java:163) at hudson.XmlFile.unmarshal(XmlFile.java:158) at jenkins.model.Jenkins.loadConfig(Jenkins.java:3078) at jenkins.model.Jenkins.access$1200(Jenkins.java:307) at jenkins.model.Jenkins$16.run(Jenkins.java:3096) 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$7.runTask(Jenkins.java:1090) 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:1153) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:785)

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:1124) at jenkins.model.Jenkins.(Jenkins.java:929) at hudson.model.Hudson.(Hudson.java:86) at hudson.model.Hudson.(Hudson.java:82) at hudson.WebAppMain$3.run(WebAppMain.java:235)

Caused: hudson.util.HudsonFailedToLoad at hudson.WebAppMain$3.run(WebAppMain.java:252)

Upvotes: 3

Views: 8323

Answers (1)

Uddhav P. Gautam
Uddhav P. Gautam

Reputation: 7636

When you install Jenkins, it creates a default jenkins user. Please note your every action that you performed on Jenkins is associated with "Jenkins" user. In Ubuntu (you told your OS is Ubuntu), there is open files limit. You can know, the open files limit using ulimit -n from the user-shell. For example, if you want to know "ulimit -n" for "jenkins" user, you do: Change shell to "jenkins" user doing "su - jenkins" and then ulimit -n. The default value is 1024. You can increase this value to 4096 or more doing: ulimit -n 4096.

Alternatively, you can create a new ulimit record in /etc/security/limits.conf file as below.

jenkins      soft   nofile  4096
jenkins      hard   nofile  8192

Explanation (you can read /etc/security/limits.conf file for better understanding)

jenkins -- a user/group name

soft/ hard -- type of link. Note: soft link can be from 0 to hardlink.

nofile -- number of open files And the is value.

Upvotes: 4

Related Questions