Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-29-2021 04:05 AM
Hi,
The below error occurs frequently and cannot connect to neo4j Aura. But neo4j browser works fine, so its a problem with server down or connector?
py2neo.errors.ServiceUnavailable: Cannot connect to any known routers
conn = Graph("neo4j+s://.databases.neo4j.io:7687",
auth=("neo4j", ""), secure=True)
This is how I connect.
Thanks,
Skanda
08-30-2021 01:58 AM
I assume you removed the first part of the host name on purpose, right? Or did you try to connect to .databases.neo4j.io:7687
verbatim?
08-30-2021 02:18 AM
Yes, in the forum textarea I typed it as
<hostname> and <password>
Markdown removed it or somehow it got removed.
08-31-2021 06:54 AM
I'm not very familiar with py2neo but to me this looks like a network issue between the machine the driver is running on and Aura.
Could you please run this minimal example with the official Python driver and share the logs with us?
from neo4j import GraphDatabase
from neo4j.debug import watch
uri = "..."
driver = GraphDatabase.driver(uri, auth=("neo4j", "password"))
def workload(tx):
return tx.run("RETURN 1 as n").data()
with watch("neo4j"): # enable logging
with driver.session() as session:
session.write_transaction(workload)
driver.close()
01-26-2022 06:45 PM
I just tested this code and it works, everything is fine SUCCESS, READY, CONNECTED, etc... but I had to ask what does this means? "Attempting to update routing table from IPv4Address" because when I look at the error py2neo in the server, it says like this:
cx = self._acquire_ro(graph_name)
: File "/home/rinal/flask-projects/wordgrid/myvenv/lib/python3.8/site-package>
: ro_profiles, rw_profiles = self._get_profiles(graph_name, readonly=True)
: File "/home/rinal/flask-projects/wordgrid/myvenv/lib/python3.8/site-package>
: self.refresh_routing_table(graph_name)
: File "/home/rinal/flask-projects/wordgrid/myvenv/lib/python3.8/site-package>
: raise ServiceUnavailable("Cannot connect to any known routers")
: py2neo.errors.ServiceUnavailable: Cannot connect to any known routers
09-06-2021 04:28 AM
Thanks Rouven, Got it resolved now. May be some issues with availability I guess. I am not seeing such kind of errors now.
01-26-2022 06:27 PM
I have the same issue and I couldn't figure out how to fix this, it seems like py2neo has a connection time limit at a certain time (maybe 1-2 hours if there's no transaction/activity). Because whenever I reload the flask server, py2neo is still working. Did you resolve the issue with py2neo or instead did you change the driver with the official neo4j driver?
02-03-2022 01:58 AM
So when running the driver with a neo4j://
scheme URI (needed to work with clusters), the driver will ask the cluster members for a routing table that tells the driver where to find which cluster member and which of them serve what role (there are readers, writers, and routers). This is when you'll see
in the debug logs.
Regarding the py2neo error, I'm afraid I still cannot help much. At face value it looks like all routers it knows of are unreachable.
02-07-2022 06:52 AM
Hi Rouven,
I had this problem today and was able to connect using py2neo by changing the scheme from neo4j+s to neo4j+ssc. Hope that helps others!
03-14-2022 07:15 PM
I changed the scheme to ssc and it seems to be working. Can you explain what's the difference between +s and +ssc? Thank you!
03-15-2022 06:41 AM
Here is the link to the documentation for the official driver: https://neo4j.com/docs/python-manual/current/client-applications/#python-driver-configuration-exampl...
While I don't know for sure, I assume py2neo handles it the same way.
03-29-2022 10:27 AM
Change neo4j+s:// to neo4j+ssc:// works. Thank you!
03-14-2022 07:17 PM
I see, thank you for your answer. I appreciate it.
All the sessions of the conference are now available online