Cannot RESET after a `Neo.ClientError.Request.Invalid` FAILURE

I'm working on a driver and experiencing strange behaviours.
An invalid query returns a FAILURE from the server.
After that, I am able to send a RESET and everything is fine

C: RUN ~ ["RETRN 1 AS num", %{}, %{}]
S: FAILURE ~ %{"code" => "Neo.ClientError.Statement.SyntaxError", "message" => "Invalid input 'R': expected 'u/U' (line 1, column 4 (offset: 3))\n\"RETRN 1 AS num\"\n    ^"}
C: RESET ~ []

But with FAILURES occurring after bad COMMIT, ROLLBACK, connection is closed and I am not able to send RESET.

S: FAILURE ~ %{"code" => "Neo.ClientError.Request.Invalid", "message" => "Message 'ROLLBACK' cannot be handled by a session in the READY state."}

My question is: Is it the server which closes connection or it is a problem in my driver?
Or maybe it's related to the failure kind syntax.Error vs Request.Invalid?

Thanks for your help.

1 Like

Has someone faced this issue?

Print the cypher and try running it in Neo4j Desktop and the actual error may reveal itself. I was getting this error in Python stack trace, but the actual error was only directional relationships in CREATE -- in other words, I had a typo in my cypher.