Aviral Srivastava
Aviral Srivastava

Reputation: 4582

Failed to establish connection to Neo4j usign bolt scheme even after successfully enabling Bolt

I want to connect to Neo4j database using my creds. I am tunneling into a machine and once that is done, I open my broswer at the port: localhost:7474. I tried with both neo4j and bolt scheme to connect at the url: bolt://<node_ip>:7687 and neo4j://<node_ip>:7687 but the connection times out.

I tried checking the logs but only found that bolt scheme is enabled:

bash-4.2$ tail -f /logs/debug.log
2021-07-02 21:26:03.323+0000 WARN  [o.n.k.a.p.GlobalProcedures] Failed to load `org.apache.commons.logging.impl.LogKitLogger` from plugin jar `/home/sandbox/neo/plugins/apoc-4.2.0.2-all.jar`: org/apache/log/Logger
2021-07-02 21:26:03.946+0000 INFO  [c.n.m.g.GlobalMetricsExtension] Sending metrics to CSV file at /home/sandbox/neo/metrics
2021-07-02 21:26:03.973+0000 INFO  [o.n.b.BoltServer] Bolt enabled on 0.0.0.0:7687.
2021-07-02 21:26:03.974+0000 INFO  [o.n.b.BoltServer] Bolt (Routing) enabled on 0.0.0.0:7688.
2021-07-02 21:26:03.974+0000 INFO  [o.n.s.AbstractNeoWebServer$ServerComponentsLifecycleAdapter] Starting web server
2021-07-02 21:26:04.001+0000 INFO  [o.n.s.m.ThirdPartyJAXRSModule] Mounted unmanaged extension [n10s.endpoint] at [/rdf]
2021-07-02 21:26:05.341+0000 INFO  [c.n.s.e.EnterpriseNeoWebServer] Remote interface available at http://<node_ip>:7474/
2021-07-02 21:26:05.341+0000 INFO  [o.n.s.AbstractNeoWebServer$ServerComponentsLifecycleAdapter] Web server started.
2021-07-02 21:35:34.565+0000 INFO  [c.n.c.c.c.l.s.Segments] [system/00000000] Pruning SegmentFile{path=raft.log.0, header=SegmentHeader{formatVersion=2, recordOffset=56, prevFileLastIndex=-1, segmentNumber=0, prevIndex=-1, prevTerm=-1}}
2021-07-02 21:35:46.079+0000 INFO  [c.n.c.c.c.l.s.Segments] [neo4j/32f6599b] Pruning SegmentFile{path=raft.log.0, header=SegmentHeader{formatVersion=2, recordOffset=56, prevFileLastIndex=-1, segmentNumber=0, prevIndex=-1, prevTerm=-1}}

The query log is empty, as I could not execute any query:

bash-4.2$ tail -f query.log
2021-07-02 21:25:52.510+0000 INFO  Query started: id:1 - 1009 ms: 0 B - embedded-session        neo4j -  - call db.clearQueryCaches() - {} - runtime=pipelined - {}
2021-07-02 21:25:52.580+0000 INFO  id:1 - 1080 ms: 112 B - embedded-session     neo4j -  - call db.clearQueryCaches() - {} - runtime=pipelined - {}

The other articles or answers that I read were mostly about misconfiguration: wrong ports but I don't think that is the case with me since I checked from debug.log file that my ports are alright.

FWIW, I am using 3 replicas for my Neo4j and right now, connecting to just one pod.

I am tunnelling both the ports:

ssh -L 7687:$IP:7687 -L 7474:$IP:7474 domain_name.com -N```

Upvotes: 1

Views: 358

Answers (2)

Aviral Srivastava
Aviral Srivastava

Reputation: 4582

So, instead of providing localhost in the connection string, I made a silly mistake of writing down the actual IP and that was the reason for connection timeout.

Upvotes: 1

SultanOrazbayev
SultanOrazbayev

Reputation: 16571

Perhaps you've already checked this, but if not, can you ensure that port 7687 is also forwarded. When I tunnelled via browser, my expectation was that 7474 would be sufficient, but it turned out that forwarding 7687 is also necessary.

Upvotes: 1

Related Questions