Error starting Neo4j database server on running the master branch using docker
ammarzafar257 opened this issue · 6 comments
2023-01-25 10:31:37.831 WARN 1126 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'config' defined in class path resource [org/vrspace/server/config/NeoConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.graphdb.GraphDatabaseService]: Factory method 'config' threw exception; nested exception is java.lang.RuntimeException: Error starting Neo4j database server at /home/vrspace-latest/server/vrspace.db/data/databases
2023-01-25 10:31:37.861 INFO 1126 --- [ main] org.neo4j.driver.Driver : Closing driver instance 1374982240
2023-01-25 10:31:38.161 INFO 1126 --- [ main] org.vrspace.server.config.NeoConfig : Database shutting down...
2023-01-25 10:31:38.162 WARN 1126 --- [ main] .s.c.a.CommonAnnotationBeanPostProcessor : Destroy method on bean with name 'neoConfig' threw an exception: java.lang.NullPointerException
2023-01-25 10:31:38.428 INFO 1126 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-01-25 10:31:38.576 ERROR 1126 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'config' defined in class path resource [org/vrspace/server/config/NeoConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.graphdb.GraphDatabaseService]: Factory method 'config' threw exception; nested exception is java.lang.RuntimeException: Error starting Neo4j database server at /home/vrspace-latest/server/vrspace.db/data/databases
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.12.jar!/:5.3.12] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.12.jar!/:5.3.12]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.12.jar!/:5.3.12]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.6.jar!/:2.5.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.6.jar!/:2.5.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.6.jar!/:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.6.jar!/:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.6.jar!/:2.5.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.6.jar!/:2.5.6]
at org.vrspace.server.ServerApplication.main(ServerApplication.java:15) ~[classes!/:0.4.8-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[server-0.4.8-SNAPSHOT.jar:0.4.8-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[server-0.4.8-SNAPSHOT.jar:0.4.8-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[server-0.4.8-SNAPSHOT.jar:0.4.8-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[server-0.4.8-SNAPSHOT.jar:0.4.8-SNAPSHOT]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.neo4j.graphdb.GraphDatabaseService]: Factory method 'config' threw exception; nested exception is java.lang.RuntimeException: Error starting Neo4j database server at /home/vrspace-latest/server/vrspace.db/data/databases
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.12.jar!/:5.3.12]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.12.jar!/:5.3.12]
... 27 common frames omitted
Caused by: java.lang.RuntimeException: Error starting Neo4j database server at /home/vrspace-latest/server/vrspace.db/data/databases
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:214) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:170) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.api.DatabaseManagementServiceBuilder.newDatabaseManagementService(DatabaseManagementServiceBuilder.java:101) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.api.DatabaseManagementServiceBuilder.build(DatabaseManagementServiceBuilder.java:94) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.vrspace.server.config.NeoConfig.neoStart(NeoConfig.java:85) ~[classes!/:0.4.8-SNAPSHOT]
at org.vrspace.server.config.NeoConfig.config(NeoConfig.java:65) ~[classes!/:0.4.8-SNAPSHOT]
at org.vrspace.server.config.NeoConfig$$EnhancerBySpringCGLIB$$b8871ae9.CGLIB$config$0() ~[classes!/:0.4.8-SNAPSHOT]
at org.vrspace.server.config.NeoConfig$$EnhancerBySpringCGLIB$$b8871ae9$$FastClassBySpringCGLIB$$6d1aa227.invoke() ~[classes!/:0.4.8-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.12.jar!/:5.3.12]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.12.jar!/:5.3.12]
at org.vrspace.server.config.NeoConfig$$EnhancerBySpringCGLIB$$b8871ae9.config() ~[classes!/:0.4.8-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.12.jar!/:5.3.12]
... 28 common frames omitted
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.dbms.database.DefaultSystemGraphInitializer@688a2c09' was successfully initialized, but failed to start. Please see the attached cause exception "This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/home/vrspace-latest/server/vrspace.db/data/databases/system/neostore'.'".
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:463) ~[neo4j-common-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110) ~[neo4j-common-4.3.6.jar!/:4.3.6]
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:205) ~[neo4j-4.3.6.jar!/:4.3.6]
... 43 common frames omitted
Caused by: org.neo4j.graphdb.DatabaseShutdownException: This database is shutdown.
at org.neo4j.kernel.availability.DatabaseAvailabilityGuard.assertDatabaseAvailable(DatabaseAvailabilityGuard.java:172) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginKernelTransaction(GraphDatabaseFacade.java:197) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransactionInternal(GraphDatabaseFacade.java:176) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransaction(GraphDatabaseFacade.java:122) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransaction(GraphDatabaseFacade.java:116) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransaction(GraphDatabaseFacade.java:104) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTx(GraphDatabaseFacade.java:99) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.SystemGraphComponents.initializeSystemGraph(SystemGraphComponents.java:88) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.DefaultSystemGraphInitializer.initializeSystemGraph(DefaultSystemGraphInitializer.java:41) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.SystemGraphInitializer.start(SystemGraphInitializer.java:29) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442) ~[neo4j-common-4.3.6.jar!/:4.3.6]
... 45 common frames omitted
Caused by: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/home/vrspace-latest/server/vrspace.db/data/databases/system/neostore'.'
at org.neo4j.io.pagecache.impl.SingleFilePageSwapper.acquireLock(SingleFilePageSwapper.java:221) ~[neo4j-io-4.3.6.jar!/:4.3.6]
at org.neo4j.io.pagecache.impl.SingleFilePageSwapper.(SingleFilePageSwapper.java:147) ~[neo4j-io-4.3.6.jar!/:4.3.6]
at org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory.createPageSwapper(SingleFilePageSwapperFactory.java:55) ~[neo4j-io-4.3.6.jar!/:4.3.6]
at org.neo4j.io.pagecache.impl.muninn.MuninnPagedFile.(MuninnPagedFile.java:172) ~[neo4j-io-4.3.6.jar!/:4.3.6]
at org.neo4j.io.pagecache.impl.muninn.MuninnPageCache.map(MuninnPageCache.java:506) ~[neo4j-io-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.DatabasePageCache.map(DatabasePageCache.java:67) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.store.MetaDataStore.getRecord(MetaDataStore.java:372) ~[neo4j-record-storage-engine-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.impl.store.MetaDataStore.getStoreId(MetaDataStore.java:504) ~[neo4j-record-storage-engine-4.3.6.jar!/:4.3.6]
at org.neo4j.internal.recordstorage.RecordStorageEngineFactory.storeId(RecordStorageEngineFactory.java:206) ~[neo4j-record-storage-engine-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.database.Database.checkStoreId(Database.java:635) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.database.Database.validateStoreAndTxLogs(Database.java:598) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.kernel.database.Database.start(Database.java:420) ~[neo4j-kernel-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.AbstractDatabaseManager.startDatabase(AbstractDatabaseManager.java:188) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.DefaultDatabaseManager.startDatabase(DefaultDatabaseManager.java:156) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.DefaultDatabaseManager.startDatabase(DefaultDatabaseManager.java:39) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.AbstractDatabaseManager.forEachDatabase(AbstractDatabaseManager.java:166) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.AbstractDatabaseManager.startAllDatabases(AbstractDatabaseManager.java:113) ~[neo4j-4.3.6.jar!/:4.3.6]
at org.neo4j.dbms.database.AbstractDatabaseManager.start(AbstractDatabaseManager.java:107) ~[neo4j-4.3.6.jar!/:4.3.6]
... 46 common frames omitted
Here's your error:
Caused by: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/home/vrspace-latest/server/vrspace.db/data/databases/system/neostore'.'
Did you by any chance start the server twice?
Useful commands:
pkill java
fuser /home/vrspace-latest/server/vrspace.db/data/databases/system/neostore
There's also chance that store_lock file didn't get cleaned up. If that's the case,
rm /home/vrspace-latest/server/vrspace.db/data/databases/store_lock
should do the trick.
There's also chance that store_lock file didn't get cleaned up. If that's the case, rm /home/vrspace-latest/server/vrspace.db/data/databases/store_lock should do the trick.
Tried this command but it didn't worked for me..
So are you sure you only have one process running? Like,
ps -ax|grep java
Works for me. Please see step-by-step guide on building and running vrspace container here: https://redmine.vrspace.org/boards/2/topics/226
Not sure how this happened but there was another process running. It's working now.
Thanks