Skip to content

Commit de4096c

Browse files
renetapopovaLojjs
andauthored
Add connection exception errors (#183)
Co-authored-by: Louise Berglund <[email protected]>
1 parent 8ae4b2e commit de4096c

File tree

5 files changed

+214
-25
lines changed

5 files changed

+214
-25
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
* xref:index.adoc[]
22
* xref:errors/index.adoc[]
33
** xref:errors/all-errors.adoc[]
4+
** xref:errors/gql-errors.adoc[]
45
* xref:notifications/index.adoc[]
56
** xref:notifications/all-notifications.adoc[]
67
* xref:changelogs.adoc[]
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
:description: This section describes the GQLSTATUS errors that Neo4j can return, grouped by category, and an example of when they can occur.
2+
3+
[[neo4j-gqlstatus-errors]]
4+
= List of all GQLSTATUS server error codes
5+
6+
//The following page provides an overview of all server errors in Neo4j, along with some scenarios and their possible solutions.
7+
The following page provides an overview of all GQLSTATUS server error codes in Neo4j.
8+
All errors in Neo4j have severity level `ERROR`.
9+
10+
* <<_connection-exceptions, Connection exceptions>>
11+
12+
13+
[[_connection-exceptions]]
14+
== Connection exceptions
15+
16+
Connection exceptions occur when the client is unable to connect to the server for various reasons such as network issues, server-side routing being disabled, or the database being unavailable, etc.
17+
18+
=== 08000
19+
20+
Status description:: error: connection exception
21+
22+
=== 08007
23+
24+
Status description:: error: connection exception - transaction resolution unknown
25+
26+
=== 08N00
27+
28+
Status description:: error: connection exception - unable to connect to database. Unable to connect to database { $db }. Unable to get bolt address of the leader. Check the status of the database. Retrying your request at a later time may succeed.
29+
30+
31+
=== 08N01
32+
33+
Status description:: error: connection exception - unable to write to database. Unable to write to database { $db } on this server. Server-side routing is disabled. Either connect to the database leader directly or enable server-side routing by setting '{ $cfgSetting }=true'.
34+
35+
//Possible solutions:
36+
//Either connect to the database directly using the driver or interactively with the `:use { $db }` command), or enable server-side routing by setting `dbms.routing.enabled=true` in the configuration.
37+
38+
=== 08N02
39+
40+
Status description:: error: connection exception - unable to connect to database. Unable to connect to database { $db }. Server-side routing is disabled. Either connect to { $db } directly, or enable server-side routing by setting '{ $cfgSetting }=true'.
41+
42+
Example error description:: error: connection exception - unable to route to database. Unable to connect to database `my_db`. Server-side routing is disabled. Either connect to `my_db` directly, or enable server-side routing by setting 'dbms.routing.enabled=true'.
43+
44+
//Possible solutions:
45+
//Either connect to the database directly using the driver or interactively with the `:use { $db }` command), or enable server-side routing by setting `dbms.routing.enabled=true` in the configuration.
46+
47+
=== 08N03
48+
49+
Status description:: error: connection exception - failed to write to graph. Failed to write to graph { $graph }. Check the defined access mode in both driver and database.
50+
51+
=== 08N04
52+
53+
Status description:: error: unable to route use clause. Routing with { $clause } is not supported in embedded sessions. Connect to the database directly or try running the query using a Neo4j driver or the HTTP API.
54+
55+
=== 08N05
56+
57+
Status description:: error: connection exception - unable to route administration command. Routing administration commands is not supported in embedded sessions. Connect to the system database directly or try running the query using a Neo4j driver or the HTTP API.
58+
59+
=== 08N06
60+
61+
Status description:: error: connection exception - protocol error. General network protocol error.
62+
63+
=== 08N07
64+
65+
Status description:: error: connection exception - not the leader. This member is not the leader.
66+
67+
//Possible solutions:
68+
//No write operations are allowed directly on this database. Connect to the leader directly or enable server-side routing by setting `dbms.routing.enabled=true` in the configuration.
69+
70+
=== 08N08
71+
72+
Status description:: error: connection exception - database is read only. This database is read only on this server.
73+
74+
=== 08N09
75+
76+
Status description:: error: connection exception - database unavailable. The database { $db } is currently unavailable. Check the database status. Retry your request at a later time.
77+
78+
=== 08N10
79+
80+
Status description:: error: connection exception - invalid server state. The server is not in a state that can process a message of type: { $boltMsgType }.
81+
82+
=== 08N11
83+
84+
Status description:: error: connection exception - request error. The request is invalid and could not be processed by the server. See cause for further details.
85+
86+
=== 08N12
87+
88+
Status description:: error: connection exception - failed to parse bookmark. Failed to parse the supplied bookmark. Verify it is correct or check the debug log for more information.
89+
90+
=== 08N13
91+
92+
Status description:: error: connection exception - database not up to requested bookmark. The database { $db } is not up to the requested bookmark { $transactionId1 }. The latest transaction ID is { $transactionId2 }.
93+
94+
=== 08N14
95+
96+
Status description:: error: connection exception - alias chains are not permitted. Unable to provide a routing table for the database identifed by the alias { $alias1 } because the request comes from another alias { $alias2 } and alias chains are not permitted.
97+
98+
=== 08N15
99+
100+
Status description:: error: connection exception - no such routing policy. Policy definition of the routing policy { $routingPolicy } could not be found. Verify that the spelling is correct.

modules/ROOT/pages/errors/index.adoc

Lines changed: 87 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,92 @@
1-
:description: The Neo4j error codes for Neo4j version {neo4j-version}.
2-
3-
[[error-codes]]
1+
:description: The Neo4j error codes for Neo4j version.
2+
[[neo4j-errors]]
43
= Server errors
54

6-
Error codes are Neo4j status codes returned by the server when the execution of a query fails.
7-
They always have the severity level `ERROR`.
8-
Errors are grouped based on the type of the error code:
5+
// [role=label--version-5.25]
6+
// [[gqlstatus-error-object]]
7+
// == GQL-status error object
8+
9+
// [[gqlstatus-standard-defined-codes]]
10+
// === Standard-defined GQLSTATUS codes
911

10-
Client errors::
11-
These errors are caused by the client and are usually related to the request itself.
12-
Client errors have the prefix `Neo.ClientError`.
12+
// .Standard-defined GQLSTATUS error codes
13+
// [options="header", cols="<1s,<4"]
14+
// [%collapsible]
15+
// |===
16+
// |GQLSTATUS code | StatusDescription
17+
// | 08000 | error: connection exception
18+
// | 08007 | error: connection exception - transaction resolution unknown
19+
// | 22000 | error: data exception
20+
// | 22001 | error: data exception - string data, right truncation
21+
// | 22003 | error: data exception - numeric value out of range. The numeric value `$value` is outside the required range.
22+
// | 22004 | error: data exception - null value not allowed
23+
// | 22007 | error: data exception - invalid date, time, or datetime format
24+
// | 22008 | error: data exception - datetime field overflow
25+
// | 22011 | error: data exception - substring error
26+
// | 22012 | error: data exception - division by zero
27+
// | 22015 | error: data exception - interval field overflow
28+
// | 22018 | error: data exception - invalid character value for cast. The character value `$value` is an invalid argument for the specified cast.
29+
// | 2201E | error: data exception - invalid argument for natural logarithm. The value `$value` is an invalid argument for the specified natural logarithm.
30+
// | 2201F | error: data exception - invalid argument for power function. The value `$value` is an invalid argument for the specified power function.
31+
// | 22027 | error: data exception - trim error
32+
// | 2202F | error: data exception - array data, right truncation
33+
// | 22G02 | error: data exception - negative limit value
34+
// | 22G03 | error: data exception - invalid value type
35+
// | 22G04 | error: data exception - values not comparable
36+
// | 22G05 | error: data exception - invalid date, time, or datetime function field name
37+
// | 22G06 | error: data exception - invalid datetime function value
38+
// | 22G07 | error: data exception - invalid duration function field name
39+
// | 22G0B | error: data exception - list data, right truncation
40+
// | 22G0C | error: data exception - list element error
41+
// | 22G0F | error: data exception - invalid number of paths or groups
42+
// | 22G0H | error: data exception - invalid duration format. The duration format `$format` is invalid.
43+
// | 22G0M | error: data exception - multiple assignments to a graph element property
44+
// | 22G0N | error: data exception - number of node labels below supported minimum
45+
// | 22G0P | error: data exception - number of node labels exceeds supported maximum
46+
// | 22G0Q | error: data exception - number of edge labels below supported minimum
47+
// | 22G0R | error: data exception - number of edge labels exceeds supported maximum
48+
// | 22G0S | error: data exception - number of node properties exceeds supported maximum
49+
// | 22G0T | error: data exception - number of edge properties exceeds supported maximum
50+
// | 22G0U | error: data exception - record fields do not match
51+
// | 22G0V | error: data exception - reference value, invalid base type
52+
// | 22G0W | error: data exception - reference value, invalid constrained type
53+
// | 22G0X | error: data exception - record data, field unassignable
54+
// | 22G0Y | error: data exception - record data, field missing
55+
// | 22G0Z | error: data exception - malformed path
56+
// | 22G10 | error: data exception - path data, right truncation
57+
// | 22G11 | error: data exception - reference value, referent deleted
58+
// | 22G12 | error: data exception - invalid value type
59+
// | 22G13 | error: data exception - invalid group variable value
60+
// | 22G14 | error: data exception - incompatible temporal instant unit groups
61+
// | 25000 | error: invalid transaction state
62+
// | 25G01 | error: invalid transaction state - active GQL-transaction
63+
// | 25G02 | error: invalid transaction state - catalog and data statement mixing not supported
64+
// | 25G03 | error: invalid transaction state - read-only GQL-transaction
65+
// | 25G04 | error: invalid transaction state - accessing multiple graphs not supported
66+
// | 2D000 | error: invalid transaction termination
67+
// | 40000 | error: transaction rollback
68+
// | 40003 | error: transaction rollback - statement completion unknown
69+
// | 42000 | error: syntax error or access rule violation
70+
// | 42001 | error: syntax error or access rule violation - invalid syntax
71+
// | 42002 | error: syntax error or access rule violation - invalid reference
72+
// | 42004 | error: syntax error or access rule violation - use of visually confusable identifiers
73+
// | 42006 | error: syntax error or access rule violation - number of edge labels below supported minimum
74+
// | 42007 | error: syntax error or access rule violation - number of edge labels exceeds supported maximum
75+
// | 42008 | error: syntax error or access rule violation - number of edge properties exceeds supported maximum
76+
// | 42009 | error: syntax error or access rule violation - number of node labels below supported minimum
77+
// | 42010 | error: syntax error or access rule violation - number of node labels exceeds supported maximum
78+
// | 42011 | error: syntax error or access rule violation - number of node properties exceeds supported maximum
79+
// | 42012 | error: syntax error or access rule violation - number of node type key labels below supported minimum
80+
// | 42013 | error: syntax error or access rule violation - number of node type key labels exceeds supported maximum
81+
// | 42014 | error: syntax error or access rule violation - number of edge type key labels below supported minimum
82+
// | 42015 | error: syntax error or access rule violation - number of edge type key labels exceeds supported maximum
83+
// | G1000 | error: dependent object error
84+
// | G1001 | error: dependent object error - edges still exist
85+
// | G1002 | error: dependent object error - endpoint node is deleted
86+
// | G1003 | error: dependent object error - endpoint node not in current working graph
87+
// | G2000 | error: graph type violation
88+
// |===
1389

14-
Transient errors::
15-
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.
16-
The error can be temporary and could therefore succeed if retrying the request.
17-
Transient errors have the prefix `Neo.TransientError`.
90+
// [[gqlstatus-neo4j-defined-codes]]
91+
// === Neo4j-defined GQLSTATUS error codes
1892

19-
Database errors::
20-
These errors are caused by the database and are usually related to the database state.
21-
Database errors have the prefix `Neo.DatabaseError`.

modules/ROOT/pages/index.adoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ endif::[]
1212

1313
This document details all status codes that a Neo4j DBMS may return to indicate the outcome of a request.
1414

15+
//== GQL status codes
1516

16-
== Format
17+
18+
== Neo4j status codes
19+
20+
=== Format
1721

1822
Each Neo4j status code follows the same format:
1923

@@ -23,7 +27,7 @@ Neo.[Type].[SubType].[Name]
2327
-----
2428

2529

26-
== Types of Neo4j status codes
30+
=== Types of Neo4j status codes
2731

2832
The fact that a Neo4j status code is returned by the server does not always mean there is a fatal error.
2933
Neo4j status codes can also indicate transient problems that may go away if you retry the request.
@@ -38,7 +42,7 @@ The type of the status code determines the effect on the transaction.
3842
| Effect on the transaction
3943

4044
| xref:errors/all-errors.adoc#_client_errors[ClientError]
41-
| The Client sent a bad request - changing the request might yield a successful outcome.
45+
| The client sent a bad request - changing the request might yield a successful outcome.
4246
| Rollback
4347

4448
| xref:errors/all-errors#_transient_errors[TransientError]

modules/ROOT/pages/notifications/index.adoc

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,25 @@ Additional helper methods are exposed for some useful fields.
9393
!===
9494
|===
9595

96+
=== Standard-defined GQLSTATUS notification codes
97+
98+
The GQL standard defines a set of GQLSTATUS codes that are used to represent successful completion, warnings, and informational messages.
99+
The following table lists the standard-defined GQLSTATUS codes and their meanings:
100+
101+
.Standard-defined GQLSTATUS notification codes
102+
[options="header", cols="<1s,<4"]
103+
|===
104+
|GQLSTATUS code | StatusDescription
105+
| 00000 | note: successful completion
106+
| 00001 | note: successful completion - omitted result
107+
| 01000 | warn: warning
108+
| 01004 | warn: string data, right truncation
109+
| 01G03 | warn: graph does not exist
110+
| 01G04 | warn: graph type does not exist
111+
| 01G11 | warn: null value eliminated in set function
112+
| 02000 | note: no data
113+
| 03000 | info: informational
114+
|===
96115

97116
[[general-codes-for-success]]
98117
=== General codes for success
@@ -306,9 +325,3 @@ Finally, the list of poly-filled GQL-status objects is sorted according to the G
306325
// The following table illustrates the compatibility between the different server and driver versions for both the current Notification API and the GqlStatusObject API:
307326

308327
// TODO
309-
310-
311-
312-
313-
314-
>>>>>>> gql-notifications

0 commit comments

Comments
 (0)