Skip to end of metadata
Go to start of metadata


While indexing a repository the indexer stops and the following error can be seen in the logs (example below for an SVN repository):


The indexer has hit the the maximum permitted number of open files in Linux/UNIX operating systems.


The current values for open file descriptors and maximum allowed file descriptors can be determined by turning on debug logging under Administration >> Global Settings >> Server >> Debug Logging

After debug logging as been turned on, the Resource Monitor will provide values for ofd (open file descriptors) and mfd (maximum file descriptors):

The above output indicates that FishEye can have a maximum of 4096 file descriptors and currently is using 4080 file descriptors.


There are two possible resolutions:

  1. Optimize the Search Indexes on restart.

    More information can be found on the following page: Optimising the Search Indexes on Restart

  2. Increase the number of allowed file handles per process (and possibly for the entire system).

    There are two file handle limits that can affect FishEye/Crucible: the total number of file handles allowed per process and the number of file handles allowed on the entire system.

    FishEye/Crucible can hold a high number of open file handles which often exceeds common per-process default limits – usually between 1000 and 4000 open files. If these limits are reached we recommend increasing the limit to 40000. The total number of file handles allowed on the entire system is usually set high enough by default but on an server with many other running applications this too may need to be increased.

    These settings may vary between operating systems so please check with a system administrator or perform additional research before making any changes. Described below is the most common approach to troubleshooting and fixing this problem.

    Setting the permitted number of file handles per process

    To check the number of currently open file handles, run sudo lsof -u FISHEYE_USER (restricted to the FisheEye running user) or sudo lsof -p FISHEYE_PROCESS (restricted to the fisheye process).

    To check the permitted number of file handles per process, run ulimit -n

    To modify the permitted number of file handles per process, edit /etc/security/limits.conf and add (replace FISHEYE_USER with the name of the user that will run FishEye/Crucible or use * to make the change for all users):

    Single user: FISHEYE_USER

     It is recommended to set the limits for the FISHEYE_USER explicitly first before increasing the limit for all users.

    All users:


    Setting the permitted number of file handles over the whole system

    To check the number of open file handles, run sudo lsof.

    To check the total number of open file permitted in the whole system, run cat /proc/sys/fs/file-max.

    To modify the total number of open file permitted in the whole system, edit /etc/sysctl.conf and add the line:

    Note: After making these changes the OS will need to be restarted. For further information please see this page.

    Ubuntu note

    The Ubuntu server requires additional additional steps in order have the larger limits register (based on this article and this article):  add “session required” in /etc/pam.d/common-session.

    1. sudo vi /etc/pam.d/common-session
    2. Add session required to the end of the file.
    3. Reboot the OS.

    j2ee note

    If FishEye/Crucible is running under j2ee, add the ulimit into FishEye/Crucible's daemontool runscript.


Help us improve!
Is this article helpful?
Is it well written?
Is the content complete?


  1. How many open files are to be expected?

    On which factors does the number of open files depend?

    1. Hello, Dennis.

      The default number of open files, according to this Linux guide, is 4096, but it may vary depending on your server configuration.

      If you're experiencing issues related to the number of open files, don't hesitate to open a support ticket at

      Kind regards,
      Felipe Kraemer
      Atlassian Support

      1. Hm, seems like my question wasn't clear enough.

        I wanted to know how many open files FishEye usually has.
        And what influences this number. Size of the repository? Number of repositories?

        1. Hi Dennis,

          We're currently investigating this — you might like to follow this jira issue.


  2. This certainly worked for us - we had the default of 1024 set.  I had restarted Fisheye a couple of times which would only ever temporarily fix the issue.  Upping to 40000 for the user seems to be doing the trick.  I'll guess we'll see in time!  Thanks for the article though!!

  3. I've set the limit to 65535 files and I still get the following for Git repos:

    com.cenqua.fisheye.rep.DbException: /usr/local/fisheye/home/cache/globalfe/idx0/_3z4.tii (Too many open files)

    To be sure, I've rebooted the server and checked with ulimit.  I also monitor the number of open files used by the Atlassian user which never goes over about 2600.

    This completely prevents indexing.

  4. On Ubuntu you need to edit another file to enable the user specific limits


  5. I don't see in the documentation above or any of the replies a way to see the number of files fisheye has open - lsof -p <pid> and lsof -u FISHEYE_USER return all the files open, but not a count. So, I did this:

    sudo lsof -p <pid> | wc -l

    and it (eventually) returned 4024. Much more useful. And if 4096 is the limit, that would explain why we're getting the "Too many open files" error message. However, ulimit -n returns 1024? How does that reconcile with lsof? I followed the instructions and updated /etc/security/limits.conf to 40k, rebooted, and now ulimit -n returns 40k. We'll see if this is resolved. 


  6. With Ubuntu 14.04 and run fecru under root, I found the above step not work.

    After several trying and fix it by adding below to /etc/security/limits.conf:

    *         soft nofile 40000
    *         hard nofile 40000
    root    soft nofile 40000
    root    hard nofile 40000