Container started but neo4j connot start

HI
I pulled neo4j:latest image. and create and start a container with this command successfully:


> docker create \
> --name myneo4j \
> -p7688:7688  \
> -v $HOME/neo4j/data:/data \
> -v $HOME/neo4j/logs:/logs \
> -v $HOME/neo4j/plugins:/plugins \
> -v $HOME/neo4j/import:/var/lib/neo4j/import  \
> --env NEO4J_AUTH=neo4j/test \
>  neo4j:latest

aeb03348cf1bab0d487e250e505add56b4785c632f6560abdd701bfcfcead8fb

> docker start myneo4j
myneo4j

> docker exec -it myneo4j bash neo4j start

here is the neo4j.log file:


nohup: ignoring input
2019-10-02 16:43:40.835+0000 INFO  ======== Neo4j 3.5.11 ========
2019-10-02 16:43:40.852+0000 INFO  Starting...
2019-10-02 16:43:41.936+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@6239aba6' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@6239aba6' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@6239aba6' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)".
	at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:45)
	at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:187)
	at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:124)
	at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:91)
	at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:32)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@6239aba6' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)".
	at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:473)
	at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
	at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:180)
	... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory, /data/databases
	at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:232)
	at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:148)
	at org.neo4j.server.database.CommunityGraphFactory.newGraphDatabase(CommunityGraphFactory.java:41)
	at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:90)
	at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
	... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.internal.locker.StoreLockerLifecycleAdapter@1984b1f' was successfully initialized, but failed to start. Please see the attached cause exception "Store and its lock file has been locked by another process: /data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)".
	at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:473)
	at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
	at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:227)
	... 9 more
Caused by: org.neo4j.kernel.StoreLockException: Store and its lock file has been locked by another process: /data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access)
	at org.neo4j.kernel.internal.locker.StoreLocker.storeLockException(StoreLocker.java:116)
	at org.neo4j.kernel.internal.locker.StoreLocker.checkLock(StoreLocker.java:92)
	at org.neo4j.kernel.internal.locker.GlobalStoreLocker.checkLock(GlobalStoreLocker.java:61)
	at org.neo4j.kernel.internal.locker.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:36)
	at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
	... 11 more
2019-10-02 16:43:41.937+0000 INFO  Neo4j Server shutdown initiated by request

how solve this issue?
tnx before

If you get that error message, it usually means that two processes are trying to start a database using the same data directory.

I think that might have happened because you ran two docker start commands after each other.

If you change the command to read like this it'll work:

$  docker run \
>  --name myneo4j \
>  -p7688:7688  \
>  -v $HOME/neo4j/data:/data \
>  -v $HOME/neo4j/plugins:/plugins \
>  -v $HOME/neo4j/import:/var/lib/neo4j/import  \
>  --env NEO4J_AUTH=neo4j/test \
>   neo4j:latest
org.neo4j.commandline.admin.CommandFailed: initial password was not set because live Neo4j-users were detected.
	at org.neo4j.commandline.admin.security.SetInitialPasswordCommand.setPassword(SetInitialPasswordCommand.java:83)
	at org.neo4j.commandline.admin.security.SetInitialPasswordCommand.execute(SetInitialPasswordCommand.java:66)
	at org.neo4j.commandline.admin.AdminTool.execute(AdminTool.java:127)
	at org.neo4j.commandline.admin.AdminTool.main(AdminTool.java:51)
command failed: initial password was not set because live Neo4j-users were detected.
Active database: graph.db
Directories in use:
  home:         /var/lib/neo4j
  config:       /var/lib/neo4j/conf
  logs:         /var/lib/neo4j/logs
  plugins:      /plugins
  import:       /var/lib/neo4j/import
  data:         /var/lib/neo4j/data
  certificates: /var/lib/neo4j/certificates
  run:          /var/lib/neo4j/run
Starting Neo4j.
2019-10-04 13:40:27.299+0000 WARN  Unknown config option: causal_clustering.discovery_listen_address
2019-10-04 13:40:27.302+0000 WARN  Unknown config option: causal_clustering.raft_advertised_address
2019-10-04 13:40:27.302+0000 WARN  Unknown config option: causal_clustering.raft_listen_address
2019-10-04 13:40:27.302+0000 WARN  Unknown config option: ha.host.coordination
2019-10-04 13:40:27.303+0000 WARN  Unknown config option: causal_clustering.transaction_advertised_address
2019-10-04 13:40:27.303+0000 WARN  Unknown config option: causal_clustering.discovery_advertised_address
2019-10-04 13:40:27.303+0000 WARN  Unknown config option: ha.host.data
2019-10-04 13:40:27.303+0000 WARN  Unknown config option: causal_clustering.transaction_listen_address
2019-10-04 13:40:27.325+0000 INFO  ======== Neo4j 3.4.5 ========
2019-10-04 13:40:27.375+0000 INFO  Starting...
2019-10-04 13:40:29.798+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2019-10-04 13:40:32.168+0000 INFO  Started.
2019-10-04 13:40:33.361+0000 INFO  Remote interface available at http://localhost:7474/