Description
If the process of starting a repository at startup of FishEye throws an exception, then that repository's InfinityDB instance is left open, even though the repository is not in the STATE_RUNNING state.
This means that when the user tries to start the repository from the admin UI a spurious locking exception is thrown.
e.g. initial exception:
2014-10-15 07:18:03,907 WARN [RepoStarter-5 storesvn ] fisheye DefaultRepositoryManager$3$1-call - Problem starting repository storesvn java.lang.NullPointerException at com.atlassian.fisheye.svn.Svn2RepositoryEngine.getEarliestInState(Svn2RepositoryEngine.java:175) at com.atlassian.fisheye.svn.Svn2RepositoryEngine.initialiseRepositoryStatus(Svn2RepositoryEngine.java:127) at com.cenqua.fisheye.rep.RepositoryEngine.start(RepositoryEngine.java:218) at com.cenqua.fisheye.rep.RepositoryHandle.run(RepositoryHandle.java:404) at com.cenqua.fisheye.config.DefaultRepositoryManager.runRepository(DefaultRepositoryManager.java:352) at com.cenqua.fisheye.config.DefaultRepositoryManager$3$1.call(DefaultRepositoryManager.java:403) at com.cenqua.fisheye.config.DefaultRepositoryManager$3$1.call(DefaultRepositoryManager.java:399) at com.cenqua.fisheye.util.NamedExecution.call(NamedExecution.java:31) at com.cenqua.fisheye.config.DefaultRepositoryManager$3.call(DefaultRepositoryManager.java:399) at com.cenqua.fisheye.config.DefaultRepositoryManager$3.call(DefaultRepositoryManager.java:395) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)
will result in this Exception when the user tries to start the repo:
Caused by: java.lang.RuntimeException: com.cenqua.fisheye.rep.DbException: com.cenqua.obfuscate.idbn5uu6o.locking.FileLockException: Cannot lock file in exclusive mode - already open internally at com.cenqua.fisheye.infinitydb.CachingUniqueStringTable.initialCacheSize(CachingUniqueStringTable.java:137) at com.cenqua.fisheye.infinitydb.CachingUniqueStringTable.<init>(CachingUniqueStringTable.java:28) at com.cenqua.fisheye.infinitydb.CachingUSTDelegatorFactory.delegate(CachingUSTDelegatorFactory.java:6) at com.cenqua.fisheye.infinitydb.InfinityDbHandle.createUniqueStringTable(InfinityDbHandle.java:171) at com.cenqua.fisheye.rep.impl.CommonStringTables.createForId(CommonStringTables.java:44) at com.cenqua.fisheye.rep.impl.CommonStringTables.<init>(CommonStringTables.java:29) at com.cenqua.fisheye.svn.db.SvnStringTables.<init>(SvnStringTables.java:16) at com.atlassian.fisheye.svn.Svn2Cache.<init>(Svn2Cache.java:83) at com.atlassian.fisheye.svn.Svn2RepositoryEngine.createCache(Svn2RepositoryEngine.java:70) at com.atlassian.fisheye.svn.Svn2RepositoryEngine.createCache(Svn2RepositoryEngine.java:26) at com.cenqua.fisheye.rep.BaseRepositoryEngine.doStart(BaseRepositoryEngine.java:57) at com.cenqua.fisheye.rep.RepositoryEngine.start(RepositoryEngine.java:200) at com.cenqua.fisheye.rep.RepositoryHandle.run(RepositoryHandle.java:404) at com.cenqua.fisheye.config.DefaultRepositoryManager.runRepository(DefaultRepositoryManager.java:352) at com.atlassian.fisheye.spi.admin.impl.DefaultRepositoryAdminService.start(DefaultRepositoryAdminService.java:1329)
We should be reporting exceptions thrown during startup as engine errors in the UI.
Workaround
Completely re-index the repository:
- Stop the repository.
- Backup and delete the index folder at FISHEYE_INST/var/cache/<reponame>
- Start the repository.