Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceUnavailable: Cannot connect to any known routers after some hours - while connecting to AuraDB #949

Open
ashwathan opened this issue Sep 19, 2022 · 3 comments

Comments

@ashwathan
Copy link

ashwathan commented Sep 19, 2022

Hi Everyone,
I have created a flask application which connects to Neo4j AuraDB Free graph database instance. I have a global Graph instance which connects my neo4j db. I have the below configuration in my code.

Graph("neo4j+ssc://3951eb3f.databases.neo4j.io:7687",
                        auth=('neo4j', <password>),
                        name='neo4j', secure=True, routing=True) 

I'm using python 3.7.8 and py2neo 2021.2.3.

It works fine for 8 hours or so. After that I start to see an error message py2neo.errors.ServiceUnavailable: Cannot connect to any known routers. If I restart my flask server it starts working fine. I really need help in fixing this issue.
Here is the error stack:

  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\py2neo\database.py", line 518, in query
    result = self.auto(readonly=True).run(cypher, parameters)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\py2neo\database.py", line 991, in run
    readonly=self.readonly)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\py2neo\client\__init__.py", line 1338, in auto_run
    cx = self._acquire(graph_name)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\py2neo\client\__init__.py", line 1111, in _acquire
    return self._acquire_rw(graph_name)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\py2neo\client\__init__.py", line 1203, in _acquire_rw
    ro_profiles, rw_profiles = self._get_profiles(graph_name, readonly=False)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\py2neo\client\__init__.py", line 1016, in _get_profiles
    self.refresh_routing_table(graph_name)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\py2neo\client\__init__.py", line 1064, in refresh_routing_table
    raise ServiceUnavailable("Cannot connect to any known routers")
py2neo.errors.ServiceUnavailable: Cannot connect to any known routers
@ashwathan ashwathan changed the title ServiceUnavailable: Cannot connect to any known routers after some hours connecting to AuraDB ServiceUnavailable: Cannot connect to any known routers after some hours - while connecting to AuraDB Sep 19, 2022
@richylyq
Copy link

hey @ashwathan
did you manage to resolve the above problem? If so, can you share the solution?
I am also seeing this issue whilst running py2neo

@ggeorg02
Copy link

ggeorg02 commented Dec 4, 2022

Same issue here. Anyone got any resolution?

@ashwathan
Copy link
Author

ashwathan commented Dec 17, 2022

@richylyq @ggeorg02 I could not get it working with py2neo. But I did not face this problem using neo4j driver. https://neo4j.com/docs/python-manual/current/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants