Unable to retrieve routing information

Hello, I'm running some tests with pytest and am getting this error for a couple of the tests:

INFO neo4ju:_driver.py:187 Opened database connection.
ERROR neo4j:init.py:1212 Unable to retrieve routing information
WARNING neo4ju:_driver.py:549 Running query against fallback database neo4j.
ERROR neo4j:init.py:1212 Unable to retrieve routing information
ERROR neo4ju:_driver.py:564 Failed to run query: ServiceUnavailable: Unable to retrieve routing information
SKIPPED (Neo4j is offline: Unable to retrieve routing information)

this is a sample of the code:

def test_connect_to_db(driver):
assert isinstance(driver._driver.driver, neo4j.Neo4jDriver)

I've tried specifying the database name, and parsing the neo4j://localhost:7687/<database_name>, along with the username and password, but I get the same error.

Hi :wave:

There's really not a whole lot to go off of here. Here are two general debugging steps:

  • Try using "bolt://localhost:7687" instead of "neo4j://..." (for debugging only). This disables all routing in the driver and sometimes reveals the underlying error cause.
  • Try enabling debug logging in the driver and see if there's anything interesting in there:
    https://neo4j.com/docs/api/python-driver/current/api.html#logging

Maybe you could share a little more info to help us help you:

  • What driver version?
  • What server version?
  • What is neo4ju and where are these INFO/WARNING/ERROR messages coming from?