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

**URL:** https://community.neo4j.com/t/cannot-reset-after-a-neo-clienterror-request-invalid-failure/7138
**Category:** Drivers & Stacks
**Created:** [May 5, 2019, 2:36pm UTC](https://community.neo4j.com/t/cannot-reset-after-a-neo-clienterror-request-invalid-failure/7138 "2019-05-05T14:36:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dominique-vassard](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dominique-vassard/32/2321_2.png) [@dominique-vassard](https://community.neo4j.com/u/dominique-vassard)
#### Post date: [May 5, 2019, 2:36pm UTC](https://community.neo4j.com/t/cannot-reset-after-a-neo-clienterror-request-invalid-failure/7138/1 "2019-05-05T14:36:27Z")

</div>

Hello,  
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

```auto
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.  
Ex:

```auto
C: ROLLBACK ~ []
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.

---

<div class="post-metadata">

### Author: ![dominique-vassard](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dominique-vassard/32/2321_2.png) [@dominique-vassard](https://community.neo4j.com/u/dominique-vassard)
#### Post date: [May 21, 2019, 10:30am UTC](https://community.neo4j.com/t/cannot-reset-after-a-neo-clienterror-request-invalid-failure/7138/2 "2019-05-21T10:30:24Z")

</div>

Has someone faced this issue?

---

<div class="post-metadata">

### Author: ![geoffrey.hoffman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/geoffrey.hoffman/32/19588_2.png) [@geoffrey.hoffman](https://community.neo4j.com/u/geoffrey.hoffman)
#### Post date: [August 19, 2021, 6:57pm UTC](https://community.neo4j.com/t/cannot-reset-after-a-neo-clienterror-request-invalid-failure/7138/3 "2021-08-19T18:57:16Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![christian.h.distler](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/christian.h.distler/32/30477_2.png) [@christian.h.distler](https://community.neo4j.com/u/christian.h.distler)
#### Post date: [January 8, 2024, 12:47pm UTC](https://community.neo4j.com/t/cannot-reset-after-a-neo-clienterror-request-invalid-failure/7138/4 "2024-01-08T12:47:01Z")

</div>

When you look at the [Bolt message state transitions in version 5.1](https://neo4j.com/docs/bolt/current/appendix/version-5/), you see the following: if current state is "READY", and client sends "RUN", and server responds with "FAILURE", than the new state is "FAILED". That's the case if the Cypher you sent via RUN contains a syntaxError.

Now, if you look for current state "FAILED", there's no (sic!) client command which results in a new state "READY". In short words: from state "FAILED", there's no way back. You either stay at "FAILED", or you drop out to "DEFUNCT".

My "solution": close connection after "FAILED", and start a new one ...
