Skip to content

"Unable to retrieve routing information" #948

@SaiChaitanya13

Description

@SaiChaitanya13

Hi I have been trying to connect to the database I have created via Python. I have tried py2neo as well as neo4j Python driver. However, I am unable to connect even with the right credentials.

from neo4j import GraphDatabase
class Neo4jConnection:

def __init__(self, uri, user, pwd):
    self.__uri = uri
    self.__user = user
    self.__pwd = pwd
    self.__driver = None
    try:
        self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))
    except Exception as e:
        print("Failed to create the driver:", e)
    
def close(self):
    if self.__driver is not None:
        self.__driver.close()
    
def query(self, query, db=None):
    assert self.__driver is not None, "Driver not initialized!"
    session = None
    response = None
    try: 
        session = self.__driver.session(database=db) if db is not None else self.__driver.session() 
        response = list(session.run(query))
    except Exception as e:
        print("Query failed:", e)
    finally: 
        if session is not None:
            session.close()
    return response

conn = Neo4jConnection(uri="neo4j+s://xxxx.databases.neo4j.io", user="neo4j", pwd= "xxx")

conn.query("xxx")

For example when using this, I get this error "ERROR:neo4j:Unable to retrieve routing information
Query failed: Unable to retrieve routing information"

from neo4j import GraphDatabase
URI = "neo4j+s:// xxxx.databases.neo4j.io"
AUTH = ("neo4j", ":xxx")

with GraphDatabase.driver(URI, auth=AUTH) as driver:
driver.verify_connectivity()
I get this error when running this. ERROR:neo4j:Unable to retrieve routing information.

Could you please help me with this? Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions