Hello there! Im currently experiencing issues with the not so long ago officially announced upserting funcionality. Im running appwrite 1.7.4 self hosted and node-appwrite 17.2.0 on nextjs15. Everytime i want to use the upserting function, im getting the 500 general_unknown error. This happens if neither document exists or not. Even with a dummy table and dummy data it wont work (code below)
export async function testUpsert() {
try {
const { databases } = await createSessionClient();
await databases.upsertDocument(APPWRITE_DATABASE, "test", "test-id", {
test: "test",
});
return { success: true, message: "test_complete" };
} catch (error: any) {
return { success: false, message: error.code.toString() };
}
}
And that's the console output from the backend container, when upsert the test document
[Error] Timestamp: 2025-09-12T10:06:01+00:00
[Error] Method: PUT
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: TypeError
[Error] Message: array_unique(): Argument #1 ($array) must be of type array, null given
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Document.php
[Error] Line: 85
Creating and updating data, via their designated functions works fine tough. Ive seen another thread where someone experiencied this issue, but he was using the cloud saas version of appwrite.
Is this issue about to be fixed and maybe released soon?
Would be nice if someone knows, if im making something wrong or if this issue is about to be fixed in the near future.
Thanks a lot in advance!
Recommended threads
- Impossible to create project via CLI?
Is it possible to create a new project via the appwrite CLI ? I need to create a few projects for something I'm working on and because i don't want to do it man...
- Understanding S3 setup with appwrite
Hey, i'm planning to change the storage from local to S3, tho i have some questions to see before starting the migration. 1. Does all the `/storage/<storage_ty...
- S3 files like health6a079a79afaa25.44072...
I migrated to another external S3 host for my appwrite and in many (but not all) folders a file (something like health6a079a79afaa25.44072323 - file itself is e...