Skip to content
Back

general_unknown server error for upsertDocument

  • 0
  • Self Hosted
  • Databases
VeepZy
16 Jul, 2025, 12:11

Hey all, i updated the node-sdk to 17.1.0 and tried the upsertDocument function added, but that gives me the error:

TypeScript
"name": "AppwriteException",
"code": 500,
"type": "general_unknown",
"response": "{\"message\":\"Server Error\",\"code\":500,\"type\":\"general_unknown\",\"version\":\"1.7.4\"}"

I checked if we needed to update the database as we are self hosting but 1.7.4 seems to be correct. Am i missing something?

Edit:

TypeScript
2025-07-16T12:17:29.538332908Z [Error] Timestamp: 2025-07-16T12:17:29+00:00
2025-07-16T12:17:29.538376777Z [Error] Method: PUT
2025-07-16T12:17:29.538384270Z [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
2025-07-16T12:17:29.538390823Z [Error] Type: PDOException
2025-07-16T12:17:29.538396501Z [Error] Message: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
2025-07-16T12:17:29.538402408Z [Error] File: @swoole/library/core/Database/PDOStatementProxy.php
2025-07-16T12:17:29.538408120Z [Error] Line: 49

This is the error in the appwrite logs

TL;DR
Developers are encountering a general_unknown server error when trying to use the upsertDocument function after updating to node-sdk 17.1.0. The error points to a Server Error with code 500. Despite confirming the correct database version, the issue persists. In the appwrite logs, a PDOException related to mismatched tokens is seen. **Solution:** It seems like the error is related to a mismatch between the number of bound variables and tokens in the PDO statement. Please review the code to ensure the correct number of variables are being passed.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more