neo4j-contrib / py2neo

EOL! Py2neo is a comprehensive Neo4j driver library and toolkit for Python.
https://py2neo.org
Apache License 2.0
20 stars 8 forks source link

Failed to read message exception #954

Open ErangaD opened 1 year ago

ErangaD commented 1 year ago

I use the latest py2neo version and in the server logs I can see this error message keeps appearing (not always). It affects the users of the application sometimes. Failed to read message

I tried to debug the issue. I am using bolt connection inside an azure app service. This happens when the graph.run(query).data() is executed and after few minutes (usually 3 - 4 minutes) this throws the'Failed to read message' exception. It seems this is thrown inside the Wire read.

Screenshot 2022-12-10 at 14 30 18

I have seen a similar issue reported here #844 Any solution or workaround is highly appreciated.

ErangaD commented 1 year ago

I also see this in Neo4j server debug logs.

Screenshot 2022-12-12 at 09 40 29
ErangaD commented 1 year ago

As a workaround, I was able to resolve this issue by executing a dummy query once a minute. It is not the best solution but it works. I think what happens is the database connection gets abandoned after some time if the connection is not used for a while. And that connection is used even though it is closed which leads to this error. I guess if this library can address this issue, it would be great.