Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-08-2020 07:35 AM
Hello, I seem to be running into the following error and can't pinpoint the cause:
neobolt.exceptions.ServiceUnavailable: Failed to read from defunct connection Address(host='localhost', port=7687) (Address(host='127.0.0.1', port=7687))
My general workflow is something like this:
uri = "bolt://localhost:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", mypass))
db = driver.session()
with db.begin_transaction() as tx:
for d in my_data:
q = get_query(d)
tx.run(q)
tx.success = True
driver.close()
The code runs fine for a while, and several nodes and relationships are successfully added to the graph. But then I will randomly get the error pasted above. Is there anything unusual in my code snippet? What might be the cause of the above error?
04-26-2020 12:48 PM
I am having the same issue, it seems like the connection to the neo4j database get's cancelled after a while. I am looking for a way to keep the connection open or reopen the connection after closure
06-23-2020 01:51 AM
Hello,
I had the same problem. Looking at https://neo4j.com/docs/driver-manual/current/session-api/simple/#driver-simple-transaction-fn gave me a way to change my code.
Hope this helps...
All the sessions of the conference are now available online