Getting the error Failed to read from defunct connection IPv4Address(('test-poc-nlb-3428510bf0ef3f90.elb.eu-west-2.amazonaws.com', 7687)) (ResolvedIPv4Address(('52.56.138.72', 7687))) -------

Hi, I am facing this issue recently.

Whilst trying to login to the neo4j database, using the url , the connection is happening in the beginning. However, when I am trying to upload data into it, it responds but after few minutes the connectivity dies out and then it never connects. Please see below the error message. I have created the neo4j environment using CloudFormation stack and it is hosted from an Ec2 instance within an AWS account. The cloudFormation stack was taken from AWS Marketplace.

SessionExpired: Failed to read from defunct connection IPv4Address(('test-poc-nlb-e259b5fb210767e5.elb.eu-west-2.amazonaws.com', 7687)) (ResolvedIPv4Address(('18.135.56.139', 7687)))

1 Like

I'm having this same issue using django. Its hosted in a fargate instance inside a ecs cluster and connecting to a neo4j database hosted by neo4j.

I'm not sharing sessions in between threads. I create a new session for each request, from a existing GraphDatabase.driver().

def graph_query(cypher_string: str, parameters = {}):
    with social_graph.session() as session:
        response = session.run(query=cypher_string, parameters=parameters)
        return response.values()