title: Open Externally Locked Neo4j Store
body: <p>I am currently unable to start a neo4j instance on a server where it was previously working. Neo4j produces an error saying one of the files is externally locked. From reading answers to similar questions I know this usually means another instance is currently using the store.</p>
  
  <p>I have used lsof to look for any open files with 'neo' in their name but there are no open files.</p>
  
  <p>I have used ps to look for any process with 'neo' or 'java' it it's name but no luck with that either.</p>
  
  <p>I am not sure where to go from here to get neo4j working again. How do I figure out why this file is locked?</p>
  
  <pre><code>[site@x neo4j]$ neo4jstart-234.sh
  [site@x neo4j]$ WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
  Starting Neo4j Server console-mode...
  2017-07-20 10:37:51.073-0400 INFO  Successfully shutdown Neo4j Server
  2017-07-20 10:37:51.074-0400 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@79b877d2' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@79b877d2' was successfully initialized, but failed to start. Please see attached cause exception.
  org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@79b877d2' was successfully initialized, but failed to start. Please see attached cause exception.
          at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:67)
          at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:235)
          at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:97)
          at org.neo4j.server.CommunityBootstrapper.start(CommunityBootstrapper.java:48)
          at org.neo4j.server.CommunityBootstrapper.main(CommunityBootstrapper.java:35)
  Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@79b877d2' was successfully initialized, but failed to start. Please see attached cause exception.
          at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
          at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
          at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:195)
          ... 3 more
  Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /scratch/neo4j/neo4j-community-2.3.4/data/graph.db
          at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
          at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
          at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
          at org.neo4j.server.CommunityNeoServer$1.newGraphDatabase(CommunityNeoServer.java:66)
          at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:95)
          at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
          ... 5 more
  Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@14c7f72f' was successfully initialized, but failed to start. Please see attached cause exception.
          at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
          at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
          at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:112)
          at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
          at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
          at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
          ... 10 more
  Caused by: org.neo4j.kernel.impl.store.UnderlyingStorageException: Unable to open store file: /scratch/neo4j/neo4j-community-2.3.4/data/graph.db/neostore.nodestore.db.labels
          at org.neo4j.kernel.impl.store.CommonAbstractStore.checkStorage(CommonAbstractStore.java:161)
          at org.neo4j.kernel.impl.store.CommonAbstractStore.initialise(CommonAbstractStore.java:102)
          at org.neo4j.kernel.impl.store.NeoStores.initialize(NeoStores.java:429)
          at org.neo4j.kernel.impl.store.NeoStores$StoreType$1.open(NeoStores.java:85)
          at org.neo4j.kernel.impl.store.NeoStores$StoreType$1.open(NeoStores.java:78)
          at org.neo4j.kernel.impl.store.NeoStores.openStore(NeoStores.java:422)
          at org.neo4j.kernel.impl.store.NeoStores.getOrCreateStore(NeoStores.java:467)
          at org.neo4j.kernel.impl.store.NeoStores.&lt;init&gt;(NeoStores.java:365)
          at org.neo4j.kernel.impl.store.StoreFactory.openNeoStores(StoreFactory.java:174)
          at org.neo4j.kernel.impl.store.StoreFactory.openAllNeoStores(StoreFactory.java:138)
          at org.neo4j.kernel.NeoStoreDataSource.buildNeoStore(NeoStoreDataSource.java:661)
          at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:535)
          at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
          ... 15 more
  Caused by: org.neo4j.io.pagecache.impl.FileLockException: Externally locked: /scratch/neo4j/neo4j-community-2.3.4/data/graph.db/neostore.nodestore.db.labels
          at org.neo4j.io.pagecache.impl.SingleFilePageSwapper.acquireLock(SingleFilePageSwapper.java:209)
          at org.neo4j.io.pagecache.impl.SingleFilePageSwapper.&lt;init&gt;(SingleFilePageSwapper.java:160)
          at org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory.createPageSwapper(SingleFilePageSwapperFactory.java:64)
          at org.neo4j.io.pagecache.impl.muninn.MuninnPagedFile.&lt;init&gt;(MuninnPagedFile.java:95)
          at org.neo4j.io.pagecache.impl.muninn.MuninnPageCache.map(MuninnPageCache.java:357)
          at org.neo4j.kernel.impl.store.CommonAbstractStore.checkStorage(CommonAbstractStore.java:140)
          ... 27 more
  </code></pre>