Skip to content

Commit ecfff07

Browse files
authored
Add error codes reference (#104)
1 parent b92b582 commit ecfff07

File tree

3 files changed

+260
-2
lines changed

3 files changed

+260
-2
lines changed

mint.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,13 @@
418418
"group": "Resources",
419419
"pages": [
420420
"resources/demo-apps-example-projects",
421-
"resources/local-first-software",
421+
{
422+
"group": "Troubleshooting",
423+
"pages": [
424+
"resources/troubleshooting",
425+
"resources/troubleshooting/error-codes"
426+
]
427+
},
422428
{
423429
"group": "Usage & Billing",
424430
"pages": [
@@ -427,11 +433,11 @@
427433
"resources/usage-and-billing-faq"
428434
]
429435
},
430-
"resources/troubleshooting",
431436
"resources/performance-and-limits",
432437
"resources/feature-status",
433438
"resources/supported-hardware",
434439
"resources/faq",
440+
"resources/local-first-software",
435441
"resources/release-notes",
436442
"resources/roadmap",
437443
"resources/blog",

resources/troubleshooting.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "Troubleshooting"
33
description: "Summary of common issues, troubleshooting tools and pointers."
4+
sidebarTitle: "Overview"
45
---
56

67
## Common issues
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
---
2+
title: "Error Codes Reference"
3+
description: "Complete list of PowerSync error codes with explanations and troubleshooting guidance."
4+
sidebarTitle: "Error Codes"
5+
---
6+
7+
This reference documents PowerSync error codes organized by component, with troubleshooting suggestions for developers. Use the search bar to look up specific error codes (e.g., `PSYNC_R0001`).
8+
9+
# PSYNC_Rxxxx: Sync rules issues
10+
11+
- **PSYNC_R0001**:
12+
Catch-all sync rules parsing error, if no more specific error is available
13+
14+
# PSYNC_Sxxxx: Service issues
15+
16+
- **PSYNC_S0001**:
17+
Internal assertion.
18+
19+
If you see this error, it might indicate a bug in the service code.
20+
21+
- **PSYNC_S0102**:
22+
TEARDOWN was not acknowledged.
23+
24+
This happens when the TEARDOWN argument was not supplied when running
25+
the service teardown command. The TEARDOWN argument is required since
26+
this is a destructive command.
27+
28+
Run the command with `teardown TEARDOWN` to confirm.
29+
30+
## PSYNC_S1xxx: Replication issues
31+
32+
- **PSYNC_S1002**:
33+
Row too large.
34+
35+
There is a 15MB size limit on every replicated row - rows larger than
36+
this cannot be replicated.
37+
38+
- **PSYNC_S1003**:
39+
Sync rules have been locked by another process for replication.
40+
41+
This error is normal in some circumstances:
42+
1. In some cases, if a process was forcefully terminated, this error may occur for up to a minute.
43+
2. During rolling deploys, this error may occur until the old process stops replication.
44+
45+
If the error persists for longer, this may indicate that multiple replication processes are running.
46+
Make sure there is only one replication process apart from rolling deploys.
47+
48+
- **PSYNC_S1004**:
49+
JSON nested object depth exceeds the limit of 20.
50+
51+
This may occur if there is very deep nesting in JSON or embedded documents.
52+
53+
## PSYNC_S11xx: Postgres replication issues
54+
55+
- **PSYNC_S1101**:
56+
Replication assertion error.
57+
58+
If you see this error, it might indicate a bug in the service code.
59+
60+
- **PSYNC_S1103**:
61+
Aborted initial replication.
62+
63+
This is not an actual error - it is expected when the replication process
64+
is stopped, or if replication is stopped for any other reason.
65+
66+
- **PSYNC_S1104**:
67+
Explicit cacert is required for `sslmode: verify-ca`.
68+
69+
Use either verify-full, or specify a certificate with verify-ca.
70+
71+
- **PSYNC_S1105**:
72+
`database` is required in connection config.
73+
74+
Specify the database explicitly, or in the `uri` field.
75+
76+
- **PSYNC_S1106**:
77+
`hostname` is required in connection config.
78+
79+
Specify the hostname explicitly, or in the `uri` field.
80+
81+
- **PSYNC_S1107**:
82+
`username` is required in connection config.
83+
84+
Specify the username explicitly, or in the `uri` field.
85+
86+
- **PSYNC_S1108**:
87+
`password` is required in connection config.
88+
89+
Specify the password explicitly, or in the `uri` field.
90+
91+
- **PSYNC_S1109**:
92+
Invalid database URI.
93+
94+
Check the URI scheme and format.
95+
96+
- **PSYNC_S1110**:
97+
Invalid port number.
98+
99+
Only ports in the range 1024 - 65535 are supported.
100+
101+
- **PSYNC_S1141**:
102+
Publication does not exist.
103+
104+
Run: `CREATE PUBLICATION powersync FOR ALL TABLES` on the source database.
105+
106+
- **PSYNC_S1142**:
107+
Publication does not publish all changes.
108+
109+
Create a publication using `WITH (publish = "insert, update, delete, truncate")` (the default).
110+
111+
- **PSYNC_S1143**:
112+
Publication uses publish_via_partition_root.
113+
114+
## PSYNC_S13xx: MongoDB replication issues
115+
116+
- **PSYNC_S1301**:
117+
Generic MongoServerError.
118+
119+
- **PSYNC_S1302**:
120+
Generic MongoNetworkError.
121+
122+
- **PSYNC_S1303**:
123+
MongoDB internal TLS error.
124+
125+
If connection to a shared cluster on MongoDB Atlas, this could be an IP Acccess List issue.
126+
Check that the service IP is allowed to connect to the cluster.
127+
128+
- **PSYNC_S1304**:
129+
MongoDB connection DNS error.
130+
131+
Check that the hostname is correct.
132+
133+
- **PSYNC_S1305**:
134+
MongoDB connection timeout.
135+
136+
Check that the hostname is correct, and that the service IP is allowed to connect to the cluster.
137+
138+
- **PSYNC_S1306**:
139+
MongoDB authentication error.
140+
141+
Check the username and password.
142+
143+
- **PSYNC_S1307**:
144+
MongoDB authorization error.
145+
146+
Check that the user has the required priviledges.
147+
148+
- **PSYNC_S1341**:
149+
Sharded MongoDB Clusters are not supported yet.
150+
151+
- **PSYNC_S1342**:
152+
Standalone MongoDB instances are not supported - use a replicaset.
153+
154+
- **PSYNC_S1343**:
155+
PostImages not enabled on a source collection.
156+
157+
Use `post_images: auto_configure` to configure post images automatically, or enable manually:
158+
159+
```
160+
db.runCommand({
161+
collMod: 'collection-name',
162+
changeStreamPreAndPostImages: { enabled: true }
163+
});
164+
```
165+
166+
## PSYNC_S14xx: MongoDB storage replication issues
167+
168+
- **PSYNC_S1402**:
169+
Max transaction tries exceeded.
170+
171+
## PSYNC_S2xxx: Service API
172+
173+
- **PSYNC_S2001**:
174+
Generic internal server error (HTTP 500).
175+
176+
See the error details for more info.
177+
178+
- **PSYNC_S2002**:
179+
Route not found (HTTP 404).
180+
181+
- **PSYNC_S2003**:
182+
503 service unavailable due to restart.
183+
184+
Wait a while then retry the request.
185+
186+
## PSYNC_S21xx: Auth errors originating on the client.
187+
188+
This does not include auth configuration errors on the service.
189+
190+
- **PSYNC_S2101**:
191+
Generic authentication error.
192+
193+
## PSYNC_S22xx: Auth integration errors
194+
195+
- **PSYNC_S2202**:
196+
IPv6 support is not enabled for the JWKS URI.
197+
198+
Use an endpoint that supports IPv4.
199+
200+
- **PSYNC_S2203**:
201+
IPs in this range are not supported.
202+
203+
Make sure to use a publically-accessible JWKS URI.
204+
205+
## PSYNC_S23xx: Sync API errors
206+
207+
- **PSYNC_S2302**:
208+
No sync rules available.
209+
210+
This error may happen if:
211+
1. Sync rules have not been deployed.
212+
2. Sync rules have been deployed, but is still busy processing.
213+
214+
View the replicator logs to see if the sync rules are being processed.
215+
216+
- **PSYNC_S2304**:
217+
Maximum active concurrent connections limit has been reached.
218+
219+
## PSYNC_S23xx: Sync API errors - MongoDB Storage
220+
221+
- **PSYNC_S2401**:
222+
Could not get clusterTime.
223+
224+
## PSYNC_S31xx: Auth configuration issues
225+
226+
- **PSYNC_S3102**:
227+
Invalid jwks_uri.
228+
229+
- **PSYNC_S3103**:
230+
Only http(s) is supported for jwks_uri.
231+
232+
## PSYNC_S32xx: Replication configuration issue.
233+
234+
- **PSYNC_S3201**:
235+
Failed to validate module configuration.
236+
237+
## PSYNC_S4000: Management / Dev APIs
238+
239+
- **PSYNC_S4001**:
240+
Internal assertion error.
241+
242+
This error may indicate a bug in the service code.
243+
244+
- **PSYNC_S4104**:
245+
No active sync rules.
246+
247+
- **PSYNC_S4105**:
248+
Sync rules API disabled.
249+
250+
When a sync rules file is configured, the dynamic sync rules API is disabled.
251+

0 commit comments

Comments
 (0)