Skip to content

Commit 91cd494

Browse files
authored
Update error codes to latest (#177)
* Update error codes * code format
1 parent 856f158 commit 91cd494

File tree

1 file changed

+89
-2
lines changed

1 file changed

+89
-2
lines changed

resources/troubleshooting/error-codes.mdx

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ This reference documents PowerSync error codes organized by component, with trou
1111
- **PSYNC_R0001**:
1212
Catch-all sync rules parsing error, if no more specific error is available
1313

14+
## PSYNC_R11xx: YAML syntax issues
15+
16+
## PSYNC_R12xx: YAML structure (schema) issues
17+
18+
## PSYNC_R21xx: SQL syntax issues
19+
20+
## PSYNC_R22xx: SQL supported feature issues
21+
22+
## PSYNC_R23xx: SQL schema mismatch issues
23+
24+
## PSYNC_R24xx: SQL security warnings
25+
1426
# PSYNC_Sxxxx: Service issues
1527

1628
- **PSYNC_S0001**:
@@ -111,6 +123,16 @@ This reference documents PowerSync error codes organized by component, with trou
111123
- **PSYNC_S1143**:
112124
Publication uses publish_via_partition_root.
113125

126+
- **PSYNC_S1144**:
127+
Invalid Postgres server configuration for replication and sync bucket storage.
128+
129+
The same Postgres server, running an unsupported version of Postgres, has been configured for both replication and sync bucket storage.
130+
Using the same Postgres server is only supported on Postgres 14 and above.
131+
This error typically indicates that the Postgres version is below 14.
132+
Either upgrade the Postgres server to version 14 or above, or use a different Postgres server for sync bucket storage.
133+
134+
## PSYNC_S12xx: MySQL replication issues
135+
114136
## PSYNC_S13xx: MongoDB replication issues
115137

116138
- **PSYNC_S1301**:
@@ -149,20 +171,42 @@ This reference documents PowerSync error codes organized by component, with trou
149171
Sharded MongoDB Clusters are not supported yet.
150172

151173
- **PSYNC_S1342**:
152-
Standalone MongoDB instances are not supported - use a replicaset.
174+
Standalone MongoDB instances are not supported - use a replica-set.
153175

154176
- **PSYNC_S1343**:
155177
PostImages not enabled on a source collection.
156178

157179
Use `post_images: auto_configure` to configure post images automatically, or enable manually:
158-
159180
```
160181
db.runCommand({
161182
collMod: 'collection-name',
162183
changeStreamPreAndPostImages: { enabled: true }
163184
});
164185
```
165186

187+
- **PSYNC_S1344**:
188+
The MongoDB Change Stream has been invalidated.
189+
190+
Possible causes:
191+
- Some change stream documents do not have postImages.
192+
- startAfter/resumeToken is not valid anymore.
193+
- The replication connection has changed.
194+
- The database has been dropped.
195+
196+
Replication will be stopped for this Change Stream. Replication will restart with a new Change Stream.
197+
198+
- **PSYNC_S1345**:
199+
Failed to read MongoDB Change Stream due to a timeout.
200+
201+
This may happen if there is a significant delay on the source database in reading the change stream.
202+
203+
If this is not resolved after retries, replication may need to be restarted from scratch.
204+
205+
- **PSYNC_S1346**:
206+
Failed to read MongoDB Change Stream.
207+
208+
See the error cause for more details.
209+
166210
## PSYNC_S14xx: MongoDB storage replication issues
167211

168212
- **PSYNC_S1402**:
@@ -183,15 +227,46 @@ This reference documents PowerSync error codes organized by component, with trou
183227

184228
Wait a while then retry the request.
185229

230+
- **PSYNC_S2004**:
231+
415 unsupported media type.
232+
233+
This code always indicates an issue with the client.
234+
186235
## PSYNC_S21xx: Auth errors originating on the client.
187236

188237
This does not include auth configuration errors on the service.
189238

190239
- **PSYNC_S2101**:
191240
Generic authentication error.
192241

242+
- **PSYNC_S2102**:
243+
Could not verify the auth token signature.
244+
245+
Typical causes include:
246+
1. Token kid is not found in the keystore.
247+
2. Signature does not match the kid in the keystore.
248+
249+
- **PSYNC_S2103**:
250+
Token has expired. Check the expiry date on the token.
251+
252+
- **PSYNC_S2104**:
253+
Token expiration period is too long. Issue shorter-lived tokens.
254+
255+
- **PSYNC_S2105**:
256+
Token audience does not match expected values.
257+
258+
Check the aud value on the token, compared to the audience values allowed in the service config.
259+
260+
- **PSYNC_S2106**:
261+
No token provided. An auth token is required for every request.
262+
263+
The Authorization header must start with "Token" or "Bearer", followed by the JWT.
264+
193265
## PSYNC_S22xx: Auth integration errors
194266

267+
- **PSYNC_S2201**:
268+
Generic auth configuration error. See the message for details.
269+
195270
- **PSYNC_S2202**:
196271
IPv6 support is not enabled for the JWKS URI.
197272

@@ -202,6 +277,9 @@ This does not include auth configuration errors on the service.
202277

203278
Make sure to use a publically-accessible JWKS URI.
204279

280+
- **PSYNC_S2204**:
281+
JWKS request failed.
282+
205283
## PSYNC_S23xx: Sync API errors
206284

207285
- **PSYNC_S2302**:
@@ -216,11 +294,20 @@ This does not include auth configuration errors on the service.
216294
- **PSYNC_S2304**:
217295
Maximum active concurrent connections limit has been reached.
218296

297+
- **PSYNC_S2305**:
298+
Too many buckets.
299+
300+
There is currently a limit of 1000 buckets per active connection.
301+
219302
## PSYNC_S23xx: Sync API errors - MongoDB Storage
220303

221304
- **PSYNC_S2401**:
222305
Could not get clusterTime.
223306

307+
## PSYNC_S23xx: Sync API errors - Postgres Storage
308+
309+
## PSYNC_S3xxx: Service configuration issues
310+
224311
## PSYNC_S31xx: Auth configuration issues
225312

226313
- **PSYNC_S3102**:

0 commit comments

Comments
 (0)