How to solve cypher-shell "Connection Refused" error

Hello,
I am running Neo4J Browser online via a server and now I need to use cypher-shell but the connection gets refused.
I tried the things suggested here (which is for the older neo4j-shell so may be not relevant):

There is this promising post but wasn't helpful to me:

The documentation doesn't mention anything about the setup settings on the server side:

My question is, is there anyone who can explain what address etc needs to match with what, and which lines need to be added to the default neo4j,conf file for cypher-shell to work?
Since there is no explanation online I am assuming that it should work fine by default but apparently something somehow went wrong with my installation perhaps. Everything else with my browser installation has always run perfectly, I also had additional applications running such as Bloom also just fine.
Thanks for your help and here are some lines that can give a hint from my cypher-shell --debug run:

org.neo4j.driver.exceptions.ServiceUnavailableException: Could not perform discovery for database 'neo4j'. No routing server available.
at org.neo4j.driver.internal.util.Futures.blockingGet(Futures.java:111)
at org.neo4j.driver.internal.InternalSession.run(InternalSession.java:62)
.................
Suppressed: org.neo4j.driver.exceptions.DiscoveryException: Failed to update routing table with server 'localhost(127.0.0.1):7474'.
.................
Caused by: org.neo4j.driver.exceptions.ServiceUnavailableException: Unable to connect to localhost(127.0.0.1):7474, ensure the database is running and that there is a working network connection to it.
...................
Caused by: org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:7474
..................

My browser is running on port 7474 of my website and the bolt is running on port 4571:

dbms.connector.bolt.listen_address=:4571
dbms.connector.bolt.advertised_address=:4571

@Sar

how do you invoke cypher-shell? Are there any command line options?

For what its worth Neo4j Browser is a Neo4j Bolt Javascript application which serves its content over a Web UI.

Correspondingly cypher-shell is a Neo4j Bolt Java application which primarily interacts only over the bolt port.

From your errors it appears you may be trying to start cypher-shell and ask it to connect on the http port :7474

1 Like

Thank you very much Dana :grinning:
It worked this way:
cypher-shell -u un -p pw -d db -a neo4j://IP_address:4571

I had always tried it with 7474, this way also did not work:
-a neo4j://localhost:4571