Neo4J fails to start when ssh tunnel is present

Hello,

I have installed Neo4J on a Debian 10 server. I followed the guide: Debian - Operations Manual

When I run neo4j start, the database fails to start. I report the log:

2020-07-24 16:38:34.995+0000 INFO  Starting...
2020-07-24 16:38:36.979+0000 INFO  ======== Neo4j 4.1.0 ========
2020-07-24 16:38:42.221+0000 ERROR Failed to start Neo4j on dbms.connector.http.listen_address, a socket address. If missing port or hostname it is acquired from dbms.default_listen_address. Error starting Neo4j database server at /var/$
java.lang.RuntimeException: Error starting Neo4j database server at /var/lib/neo4j/data/databases
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:198)
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:158)
        at org.neo4j.server.CommunityBootstrapper.createNeo(CommunityBootstrapper.java:36)
        at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:117)
        at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:87)
        at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:35)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.internal.locker.LockerLifecycleAdapter@fd07cbb' was successfully initialized, but failed to start. Please see the attached cause exception "Lock file $
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:463)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110)
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:189)
        ... 5 more
Caused by: org.neo4j.kernel.internal.locker.FileLockException: Lock file has been locked by another process: /var/lib/neo4j/data/databases/store_lock. Please ensure no other process is using this database, and that the directory is writ$
        at org.neo4j.kernel.internal.locker.Locker.storeLockException(Locker.java:176)
        at org.neo4j.kernel.internal.locker.Locker.checkLock(Locker.java:96)
        at org.neo4j.kernel.internal.locker.GlobalFileLocker.checkLock(GlobalFileLocker.java:58)
        at org.neo4j.kernel.internal.locker.GlobalLocker.checkLock(GlobalLocker.java:28)
        at org.neo4j.kernel.internal.locker.LockerLifecycleAdapter.start(LockerLifecycleAdapter.java:36)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442)
        ... 7 more
2020-07-24 16:38:42.221+0000 INFO  Neo4j Server shutdown initiated by request

My network looks like this:
Laptop -- Proxy server -- Debian Server with Neo4J

I create the following tunnel, in order to access Neo4J from my browser:
ssh -i pem_key.pem -L 7474:debian_server:7474 -L 7687:debian_server:7687 filippo@proxy_server

It looks like that Neo4J stops woorking when this tunnel is present.

Any ideas about what the problem could be? Am I doing something wrong in this? :slight_smile:
Thanks!

Please carefully look at prerequisites section of the Manual.It says something like this

Java Prerequisites (Oracle Java, Debian 9+ and Ubuntu 16.04+ only)

Neo4j 4.1 requires the Java 11 runtime. Java 11 is not included in Ubuntu 16.04 LTS or Debian 9 (stretch) and will have to be set up manually prior to installing or upgrading to Neo4j 4.1, as described below. Debian 9 users can find OpenJDK 11 in backports. Debian 10 and Ubuntu 18.04 onwards already have the Openjdk Java 11 package available through apt .

Have you fulfilled all the necessary prerequisites?

1 Like

Hello @sameerG, Thanks for your reply. I have added some details which I just discovered.
Neo4J works. It stops working when I create a tunnel.

hello, I got the same problem like this. Can you tell me how did you fix the problem and what detials did you disvovered?