Server Error 500: If you try to set Double field from given default value to Null
- 0
- Databases
- Self Hosted
db logs doesn't seems would be that helpful
In these lines
[Error] Method: PATCH
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/attributes/float/:key
[Error] Type: Exception
[Error] Message: Default value 0 does not match given type double
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
[Error] Line: 956
yaa, for some reason
should not have happen
That's for sure
So you've created a double with default value as 0 right?
yap
and then tried to change that to null via console
Can you try to change it to 0.0
Instead of 0?
umm, let me try
same error,
[Error] Timestamp: 2023-07-20T13:23:21+00:00
[Error] Method: PATCH
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/attributes/float/:key
[Error] Type: Exception
[Error] Message: Default value 0 does not match given type double
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
[Error] Line: 956
You can see here, this is how Appwrite verifying the default value for the type
So some how the value changed to 0 from the double one 0.0
Maybe it worth trying to do so with the Appwrite API https://appwrite.io/docs/server/databases?sdk=nodejs-default#databasesCreateFloatAttribute
And try to put 0.0 there
"document":{"$id":"1_3_testing","key":"testing","databaseInternalId":"1","databaseId":"64b403562105501ffe56","collectionInternalId":"3","collectionId":"64b8c9d71b86ae78319a","type":"double","status":"processing","size":0,"required":false,"signed":true,"default":0,"array":false,"format":"floatRange","formatOptions":{"min":0,"max":1},"filters":[],"options":[],"$collection":"attributes","$createdAt":"2023-07-20T13:23:13.540+00:00","$updatedAt":"2023-07-20T13:23:13.540+00:00","$internalId":"44","min":0,"max":1},
this is the attribute I created for testing
So the default is 0 the integer
I did put, min:0 and max:1
wired it shouldn't as I did pass, 0.0 as defult
I think maybe the browser doing that
let me try to check once more, and have netwrok tab
in console
{"key":"test","required":false,"min":0,"max":1,"default":0,"array":false}
network tab
Yep,
So this will cause the problem
Recommended threads
- Can't really use the S3 storage device
hi, I've linked my local MinIO Instance (it's just for testing, not for prod.) to my appwrite instance, when i'm uploading a file it's getting uploaded to the S...
- Next.js SSR Site Times Out on First Visi...
Hey everyone, I'm running a Next.js SSR site on a self-hosted Appwrite server (v1.9.0), and I've noticed a strange behavior that I'm hoping someone can help me...
- Quota not resetting
hi, im using appwrite's free tier plani hit my read limts last month and the billing cycle said it would reset on june 4th but that is today, the billing cycle ...