Repository start fails with FileLockException - Cannot lock file in exclusive mode - already open internally

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

Symptoms

Starting a repository from the UI fails with the following error on screen:

1 Error calling server:com.atlassian.fecru.gwt.admin.shared.OperationFailureException: Failed to start repository TP_CC Unknown.kGb(Unknown source:0) Unknown.qGb(Unknown source:0) Unknown.LPc(Unknown source:0) Unknown.os(Unknown source:0) Unknown.uNc(Unknown source:0) Unknown.oOc(Unknown source:0) Unknown.$bc(Unknown source:0)

And in the logs:

1 2 3 2010-12-14 17:53:40,857 ERROR [btpool0-44] fisheye.app RepositoryAdminRpcServiceImpl-generateMsgAndLogRepoActionFailure - Failed to start repository <Repository_Name> com.atlassian.fisheye.spi.admin.services.RepositoryConfigException: com.cenqua.fisheye.rep.DbException: com.cenqua.obfuscate.idblaxgxv.locking.FileLockException: Cannot lock file in exclusive mode - already open internally at com.atlassian.fisheye.spi.admin.impl.DefaultRepositoryAdminService.start(DefaultRepositoryAdminService.java:981)

Cause

This is very likely to be caused by FE-5370 - A spurious FileLockException is thrown when a repository throws an exception on startup. You need to check the logs for a previous exception during startup.

The repository cache has been locked.

Resolution

First look for a previous error during startup of the repository, usually a NullPointerException in com.atlassian.fisheye.svn.Svn2RepositoryEngine.getEarliestInState(Svn2RepositoryEngine.java:174)

If this is occurring on each restart, it is the cause of the problem.

If you find this error, you will probably need to re-index.

If there isn't a previous error, proceed below:

We need to ensure that only one process is accessing the file:

  1. Stop Fisheye

  2. Check that no other process is accessing the file using lsof FISHEYE_INST/var/cache/<repository_name>/revcache/data.bin (on Linux) or Process Explorer on Windows.

  3. If there is any other process accessing the file, stop it and check again.

If there are no other processes accessing the file, please restart the server Fisheye is running on.

If your FISHEYE_INST directory is on a networked file system, please try moving it to a local disk, as not all network file systems support file locking correctly.

If you still experience the problem, restart Fisheye with --debug switch, create a Support Zip, and send the resulting log files to Atlassian Supportfor further investigation.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.