Application fails to start with FileLockedExternallyException - Cannot lock file in exclusive mode - already in use

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

Fisheye/Crucible cannot be started and the following error is visible in the logs:

1 2 3 4 5 6 7 8 9 10 11 12 2010-01-29 13:18:46,598 INFO [main] fisheye.app InfinityDbHandle-open - opening /path/to/fisheye_inst/var/data/data0.bin with cachesize=2500000 2010-01-29 13:18:46,613 INFO [main] fisheye.app Run-mainImpl - DBE com.cenqua.fisheye.rep.DbException: com.cenqua.obfuscate.idbktbulx.locking.FileLockedExternallyException: Cannot lock file in exclusive mode - already in use at com.cenqua.fisheye.config.RootConfig.startDB(RootConfig.java:1050) at com.cenqua.fisheye.config.RootConfig.start(RootConfig.java:359) at com.cenqua.fisheye.ctl.Run.mainImpl(Run.java:169) at com.cenqua.fisheye.ctl.Run.main(Run.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Caused by: com.cenqua.obfuscate.idbktbulx.locking.FileLockedExternallyException: Cannot lock file in exclusive mode - already in use at com.cenqua.obfuscate.idbktbulx.locking.ChannelLock.<init>(InfinityDB_1.0.53:110) at com.cenqua.obfuscate.idbktbulx._ktbulxIDB.open(InfinityDB_1.0.53:707) at com.cenqua.obfuscate.idbktbulx._ktbulxIDB.open(InfinityDB_1.0.53:600) at com.cenqua.fisheye.infinitydb.InfinityDbHandle.open(InfinityDbHandle.java:55)

Cause

Fisheye/Crucible prevents multiple instances running against the same

FISHEYE_INST

by placing a

FISHEYE_INST/var/fisheye.lck

file. This "lock" is placed when:

  1. There is a running Fisheye/Crucible instance and there is an attempt to start a new one on the same FISHEYE_INST.

  2. An "abnormal" shutdown has corrupted the instance and caused the data.bin files to be locked.

Resolution

Check that there is no second instance of Fisheye/Crucible running and that no other process has the files open. To see if any of the files are currently open, the following command can be used (on a Unix system):

1 2 3 4 5 [amyers@erdinger:~]$ lsof | grep data.*bin java 24046 amyers 11u REG 14,2 7624 18559995 /Users/amyers/Applications/fisheye/fecru-2.1.3/var/data/data0.bin java 24046 amyers 26u REG 14,2 822752 18785409 /Users/amyers/Applications/fisheye/fecru-2.1.3/var/cache/CVS/revcache/data.bin java 24046 amyers 27u REG 14,2 11480 19301135 /Users/amyers/Applications/fisheye/fecru-2.1.3/var/cache/Git/revcache/data.bin java 24046 amyers 28u REG 14,2 11496 19443395 /Users/amyers/Applications/fisheye/fecru-2.1.3/var/cache/Git2/revcache/data.bin

If there are any other processes accessing these files, these will need to be stopped (e.g. restart the system) in order to clear them.

Checking the file system is also a suggested practice. NFS or other network based file systems will have their own unlocking recipes.

In-place copy has been reported to work as well. From the FISHEYE_INST directory a script containing the following actions can be executed with the right privileges over each repository's var/cache:

1 2 3 cp data.bin data.bin.cp rm data.bin mv data.bin.cp data.bin

And for the var/data:

1 2 3 cp data0.bin data0.bin.cp rm data0.bin mv data0.bin.cp data0.bin
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.