VeepZyOriginal post
Rank 1: Thread
Hey all, i updated the node-sdk to 17.1.0 and tried the upsertDocument function added, but that gives me the error:
JavaScript
"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:
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
Summary
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.