You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/errors/index.adoc
+92-72Lines changed: 92 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,29 +2,27 @@
2
2
[[neo4j-errors]]
3
3
= Server errors
4
4
5
-
A server error is returned by the Neo4j DBMS to indicate that the outcome of a Cypher query or command execution is not successful.
5
+
The Neo4j DBMS returns a server error to indicate that the outcome of a Cypher query or command execution is unsuccessful.
6
6
The driver receives these errors and sends them to the client, which displays them to the user.
7
7
8
-
Starting from version 5.25, Neo4j has a new GqlStatusObject API in addition to the existing HasStatus API.
9
-
The GqlStatusObject API provides information about the status of a Cypher query or command execution in compliance with the GQL standard.
8
+
Starting from version 5.25, the Neo4j error codes have an additional GQL-status object that provides information about the status of a Cypher query or command execution in compliance with the link:https://www.iso.org/standard/76120.html[ISO/IEC 39075:2024(en) - Information technology - Database languages - GQL Standard].
10
9
11
-
This page describes both the Neo4j error and the GQL-status object frameworks, how they are structured, the objects they provide for errors, and how to interpret them.
12
-
//It also explains the server error grouping and filtering, the error internals, and the server-driver compatibility for both the HasStatus and GqlStatusObject APIs.
10
+
This page describes the GQL-status object and the Neo4j error frameworks, their structure, the objects they provide for errors, and how to interpret them.
11
+
It also explains the error internals and the server-driver compatibility for both the GQLSTATUS and legacy errors.
13
12
14
-
15
-
[role=label--version-5.23]
13
+
[role=label--version-5.25]
16
14
[[gqlstatus-error-object]]
17
15
== GQL-status error object
18
16
19
17
In the GQL-status object framework, errors are an implementation-defined subset of the GQL-status objects that cover exceptions.
20
18
21
19
In GQL, the execution of a query from user to server always has an outcome, called the _execution outcome_.
22
-
The execution outcome is a list of GQL-status objects, ordered by the following precedence, where the first object in the list is the primary GQL-status object:
20
+
The execution outcome is a list of GQL-status objects ordered by the following precedence rules:
23
21
24
-
. Every exception condition for transaction rollback has precedence over every other exception condition.
25
-
. Every exception condition has precedence over every completion condition.
22
+
. Every exception that results in a transaction rollback takes precedence over other exceptions.
23
+
. Every exception takes precedence over any completion condition.
26
24
27
-
The GQL-status object also includes the Neo4j-specific information, such as the severity level and the classification of the error.
25
+
The GQL-status object also includes the Neo4j-specific information, such as the severity level and the error classification.
28
26
29
27
Each GQL-status object consists of the following fields:
30
28
@@ -47,75 +45,57 @@ Additional helper methods are exposed for some useful fields.
47
45
! `OPERATION_CODE` ! The operation code that the error is related to. Always defaults to `0`.
48
46
! `CURRENT_SCHEMA` ! The current schema that the error is related to. Always defaults to `/`.
49
47
! `_severity` a! The Neo4j severity level of the error, which is always `ERROR`.
50
-
!`_classification` ! The Neo4j category of the error, which can be `CLIENT_ERROR`, `TRANSIENT_ERROR`, or `DATABASE_ERROR`.
48
+
!`_classification` ! The Neo4j error classification, which can be `CLIENT_ERROR`, `TRANSIENT_ERROR`, or `DATABASE_ERROR`.
51
49
! `_position` ! The position, given by row and column, where the error is relevant in the query text.
52
50
//! `_status_parameters`! A map that contains all variable parts of the status description.
53
51
!===
54
52
|===
55
53
56
-
A GQL-status error object can also contain an optional nested GQL-status object for providing additional diagnostic information, such as a cause, which is a GQL-status object wrapped in another GQL-status object.
54
+
A GQL-status error object can also contain an optional wrapped GQL-status object to provide additional diagnostic information, such as a cause.
57
55
58
56
[[gqlstatus-neo4j-defined-codes]]
59
57
== Classes of GQLSTATUS error codes
60
58
61
-
The Neo4j-defined GQLSTATUS codes are divided into classes and subclasses, where the class code is a 2-character string (one of `00`, `01`, or `03`) and the subclass code is a 3-character string.
62
-
The class code indicates the general condition of the status (such as successful completion, warning, or information), and the subclass code provides more detailed information about the condition, such as classification and messages.
59
+
The Neo4j GQLSTATUS codes are divided into classes and subclasses.
60
+
The class code is a 2-character string that indicates the general condition of the status, such as connection exception, data exception, etc.
61
+
The subclass code is a 3-character string that provides more detailed information about the condition.
62
+
The Neo4j-define subclasses start with N, followed by a 2-digit number.
63
63
64
-
The following table lists the Neo4j-defined groups of GQLSTATUS codes and their meanings:
64
+
The following table lists the GQLSTATUS classes and their meanings:
| Unrecognized information under successful completion
98
-
99
-
| 00N6[y]
100
-
| Generic information under successful completion
101
-
102
-
| 00N7[y]
103
-
| Security information under successful completion
104
-
105
-
| 00N8[y]
106
-
| Topology information under successful completion
107
-
72
+
| 08
73
+
| connection exception
74
+
| 22
75
+
| data exception
76
+
| 25
77
+
| invalid transaction state
78
+
| 40
79
+
| transaction rollback
80
+
| 42
81
+
| syntax error or access rule violation
82
+
| 50
83
+
| general processing exception
84
+
| 51
85
+
| system configuration or operation exception
86
+
| 52
87
+
| procedure exception
108
88
|===
109
89
110
-
[[neo4j-error-object]]
111
-
== Neo4j error object
90
+
[[legacy-error-object]]
91
+
== Legacy error object
112
92
113
-
The Neo4j error object contains diagnostic information representing the *unsuccessful* outcome of a Cypher query or command execution, including severity, status code, category, description, message, and position in the query text where the error is relevant.
93
+
The Neo4j legacy error object contains diagnostic information representing the *unsuccessful* outcome of a Cypher query or command execution, including severity, status code, category, description, message, and position in the query text where the error is relevant.
114
94
Depending on the application, some of the fields from the error object might not be visible.
115
95
116
96
The error object consists of the following fields:
117
97
118
-
.Neo4j error object
98
+
.Neo4j legacy error object
119
99
[cols="<1s,<4"]
120
100
|===
121
101
|Neo4j code
@@ -133,48 +113,88 @@ Available categories are `CLIENT_ERROR`, `TRANSIENT_ERROR`, and `DATABASE_ERROR`
133
113
a|The position, given by row and column, where the error is relevant in the query text.
134
114
|===
135
115
116
+
For more information, see the xref:errors/all-errors.adoc[List of legacy server error codes].
117
+
136
118
[[error-grouping-and-filtering]]
137
119
== Server error classification
138
120
139
-
The fact that a Neo4j status code is returned by the server does not always mean there is a fatal error.
140
-
Neo4j status codes can also indicate transient problems that may go away if you retry the request.
141
-
The status code classification determines the effect on the transaction.
121
+
The fact that an error is returned by the server does not always mean that it is a fatal error.
122
+
Status codes can also indicate transient problems that may go away if you retry the request.
123
+
The server error classification determines the effect on the transaction.
| The database cannot service the request right now, retrying later might yield a successful outcome.
140
+
| These errors are detected by the server and are usually related to some kind of database unavailability, such as limits reached, out-of-memory, timeouts, etc.
141
+
The error can be temporary, therefore retrying later might yield a successful outcome.
142
+
Legacy transient errors have the prefix Neo.`TransientError`.
| These errors are caused by the database and are usually related to the database state and mean that the database failed to service the request.
147
+
Legacy database errors have the prefix `Neo.DatabaseError`.
161
148
| Rollback
162
149
163
150
|===
164
151
165
152
[[error-internals]]
166
153
== Error internals
167
154
168
-
The server and driver communicate with each other through the Bolt protocol.
169
-
During the handshake process, they agree on using the newest possible Bolt protocol version that both the server and the driver support.
170
-
For more information on the Bolt versions supported by different server versions, see the link:https://neo4j.com/docs/bolt/current/bolt-compatibility[Bolt Protocol documentation].
171
-
172
155
Neo4j supports server errors in the form of Java exceptions.
173
156
Most of these implement the `HasStatus` interface, which means they have a Neo4j status code in addition to the exception message.
174
157
175
158
On the server side, an exception contains normal Java constructors and methods like `getMessage()`, `getCause()`, etc., and additionally the `status()` method from the `HasStatus` API, which returns the Neo4j status code.
176
-
These exceptions are then sent to the driver as failure Bolt message metadata.
159
+
160
+
Starting from 5.25, the exceptions also get new compulsary fields for `gqlStatus` and `statusDescription`, and optional fields for the `diagnosticRecord` and `cause`.
161
+
The cause field is a wrapped underlying Neo4j exception, which in turn has its own GQLSTATUS, statusdescription, diagnostic record and message. +
162
+
The `getMessage()` method is kept as Java exceptions inherently have this method.
163
+
And a new classification field is added to cover the division of client errors, transient errors and database errors, which today is part of the Neo4j status code.
164
+
All of these fields construct the GQLSTATUS object, which is sent to the driver as part of the Failure Bolt message.
165
+
Exactly how this looks, depends on the combination of driver and server versions.
166
+
See <<server-driver-compatibility, Server-driver version compatibility>> for more information.
167
+
168
+
On the driver side, the Neo4jException is extended with the corresponding methods as on the server side.
169
+
The driver receives the failure message and extracts the status code and the error message.
170
+
Then, it constructs an error object with the status code, error message, and other relevant information, and sends it to the client.
171
+
172
+
// Starting from 2025.01, the diagnostic record also contains a `_status_parameters` field, which represens a map that contains all variable parts of the status description, such as labels, database names, Cypher clauses, etc.
173
+
// This field is used to provide more detailed information about the error.
174
+
175
+
== Query logging
176
+
177
+
Since the query log is server-side and DBMS wide, multiple clients connected to the same DBMS write to the same query log.
178
+
As the clients can have separate driver versions, they may have different error framework formats.
179
+
180
+
In Neo4j 5.25, the default JSON template for the query log is updated to include `errorInfo` entry.
181
+
This entry contains `GQLSTATUS`, `statusDescription`, `classification`, `position` (if applicable), and `cause` (if applicable) with the same entries.
182
+
//The `failureReason` entry is deprecated from 5.26.
183
+
184
+
[NOTE]
185
+
====
186
+
The default GQLSTATUS code 50N42 is returned when an exception does not have a GQL object. Starting from Neo4j 5.25, GQL objects are added to exceptions; therefore, you can expect many 50N42 codes. However, it’s important not to rely on this default code, as future Neo4j versions might change it by adding an appropriate GQL object to the exception. Additionally, GQL codes for external procedures are not yet stable.
187
+
====
188
+
189
+
// Starting from Neo4j 2025.01, a new JSON template is available for the query log, which is the default set in server_log.xml.
190
+
// It contains the `errorInfo` entry, but not the `failureReason` entry, which is switched off by default.
177
191
178
192
179
193
[[server-driver-compatibility]]
180
-
== Server-driver version compatibility
194
+
== Server-driver version compatibility
195
+
196
+
The server and driver communicate with each other through the Bolt protocol.
197
+
During the handshake process, they agree on using the newest possible Bolt protocol version that both the server and the driver support.
198
+
For more information on the Bolt versions supported by different server versions, see the link:https://neo4j.com/docs/bolt/current/bolt-compatibility[Bolt Protocol documentation].
Copy file name to clipboardExpand all lines: modules/ROOT/pages/index.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,10 @@ The Neo4j 5 Status Codes manual includes all status codes that a Neo4j server ma
13
13
14
14
Starting from 5.23 for notifications and 5.25 for errors, the Neo4j DBMS supports the GQL standard. +
15
15
GQL is the new link:https://www.iso.org/home.html[ISO] International Standard query language for graph databases.
16
-
Cypher®, Neo4j’s query language, supports most mandatory and a substantial portion of the optional GQL features (as defined by the ISO/IEC 39075:2024(en) - Information technology - Database languages - GQL Standard).
16
+
Cypher®, Neo4j’s query language, supports most mandatory and a substantial portion of the optional GQL features (as defined by the link:https://www.iso.org/standard/76120.html[ISO/IEC 39075:2024(en) - Information technology - Database languages - GQL Standard]).
17
17
For more information, see link:https:https://neo4j.com/docs/cypher-manual/current/appendix/gql-conformance/[Cypher Manual -> GQL conformance].
18
18
19
-
As part of this GQL compliance, Cypher now also include status codes that a GQL-compliant DBMS returns to indicate the outcome of a request.
19
+
As part of this GQL compliance, Cypher now also includes status codes that a GQL-compliant DBMS returns to indicate the outcome of a request.
20
20
For more information on GQL status code framewoks for notifications and errors, see xref:notifications/index.adoc[] and xref:errors/index.adoc[].
21
21
22
22
This manual details all status codes that a Neo4j DBMS may return, including both GQL-compliant and legacy status codes.
0 commit comments