#Server Error 500: If you try to set Double field from given default value to Null

31 messages · Page 1 of 1 (latest)

abstract quarry
#

I have create a field double and while creating that attribute I gave deafult value as 0. Now, after when try to update that defult to null, it return 500.

proud cave
#

Is this a self-hosted instance?

abstract quarry
#

1.3.7

#

happening in console

proud cave
#

Good,
Can you try to check the logs of appwrite and the database worker?

docker logs appwrite
docker logs appwrite-worker-databases
abstract quarry
# proud cave Good, Can you try to check the logs of appwrite and the database worker? ``` doc...
[Error] Message: Not Found
[Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
[Error] Line: 803
[Error] Timestamp: 2023-07-20T12:00:46+00:00
[Error] Type: Utopia\Exception
[Error] Message: Not Found
[Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
[Error] Line: 803
[Error] Timestamp: 2023-07-20T12:36:30+00:00
[Error] Type: Utopia\Exception
[Error] Message: Not Found
[Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
[Error] Line: 803
[Error] Timestamp: 2023-07-20T12:37:04+00:00
[Error] Type: Utopia\Exception
[Error] Message: Not Found
[Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
[Error] Line: 803
[Error] Timestamp: 2023-07-20T13:04:10+00:00
[Error] Type: Utopia\Exception
[Error] Message: Not Found
[Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
[Error] Line: 803
[Error] Timestamp: 2023-07-20T13:06:55+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
[Error] Timestamp: 2023-07-20T13:08:02+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
[Error] Timestamp: 2023-07-20T13:10:12+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

appwrite logs

#

db logs doesn't seems would be that helpful

proud cave
#

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
abstract quarry
#

yaa, for some reason

#

should not have happen

proud cave
#

That's for sure

#

So you've created a double with default value as 0 right?

abstract quarry
#

yap

#

and then tried to change that to null via console

proud cave
#

Can you try to change it to 0.0

#

Instead of 0?

abstract quarry
#

umm, let me try

abstract quarry
# proud cave Can you try to change it to `0.0`

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
proud cave
#

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

abstract quarry
#
"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

proud cave
#

So the default is 0 the integer

abstract quarry
#

I did put, min:0 and max:1

abstract quarry
proud cave
abstract quarry
#

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

proud cave
#

Yep,