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()
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?
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
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.
I have this problem that "Cannot connect to any known routers" while conneting to N4J after one or two hrs problem with connections like 'Graph("neo4j://.xxx:7687",
auth=("xxx", "xxx"))'. To solve this problem, I try to chage like Graph("neo4j + ssc://.xxx:7687",
auth=("xxx", "xxx"))', but I got the problem at immediately, what a huck; hahaha