Balsamiq plugins before version 4.1.15 can produce the error 'too many open files' in Confluence

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

Confluence logs can show the error 'too many open files' for various exceptions (ie. when processing a user request, when opening a database connection, etc).

For example, in atlassian-confluence.log

1 2 3 Caused by: java.net.SocketException: Too many open files at java.net.Socket.createImpl(Socket.java:460) at java.net.Socket.connect(Socket.java:587)

Diagnosis

Environment

  • Any compatible version of Confluence, combined with an older Balsamiq plugin (versions 4.1.8 to 4.1.14, inclusive)

Diagnostic Steps

  • To check the number of currently open file handles for Confluence:

    1 lsof -p $CONF_PID

    (where $CONF_PID is the process ID of the Confluence Java process)

  • Specifically, to generate a count of the number of currently open file handles for Confluence that are related to the Balsamiq plugin:

    1 lsof -p $CONF_PID | grep -i balsamiq | wc -l

  • As the OS user that runs the Confluence instance, run 'ulimit -a' and compare the above file count with the 'open files' limit:

    1 open files (-n) 32768
  • If the number of file handles reported by the above 'lsof' command is very close to (or equal) the ulimit setting, proceed to the workaround and solution below. If not, you're likely not encountering this problem and should therefore read the generic 'too many open files' article for Confluence.

Cause

The Balsamiq plugin uses SQlite files to store the Balsamiq project files (.bmpr extension). These are typically installed in the Confluence temp directory, for example:

1 /opt/atlassian/confluence/temp/balsamiq_project_7519ca1b-f6bc-4182-8529-622529c7ab295015357371694806795.bmpr

Balsamiq plugin versions 4.1.8 - 4.1.14 (inclusive) do not close the file handle for such files, and over time, the total number of file handles used by the Balsamiq plugin will increase. Eventually, the limit set by ulimit (number of open files) will be reached, triggering the 'too many open files' error.

Solution

Workaround

Restart Confluence.

Restarting will release the file handles, but the problem can eventually return (See resolution below). The length of time before the problem returns will depend on both the level of usage of the Balsamiq plugin, and the current file handle limit (check 'open files' in 'ulimit -a').

Deleting the temporary Balsamiq project files in the temp directory will also not solve the problem, because the OS will still maintain the existing open file handles (even if the files doesn't exist anymore).

Resolution

Upgrade the Balsamiq plugin to version 4.1.15 or later. From version 4.1.15 onwards, the Balsamiq plugin contains a fix to close file handles once the temporary file work is done. This prevents the problem from occurring.

For further questions regarding individual Balsamiq plugins, contact Balsamiq support.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.