Closed maximilianmaihoefner closed 5 minutes ago
This is the full appwrite.json
-File created by the CLI:
{
"projectId": "test",
"projectName": "Test",
"collections": [
{
"$id": "62212c12df87ffcd4478",
"$read": [],
"$write": [],
"name": "MyCollection",
"enabled": true,
"permission": "collection",
"attributes": [
{
"key": "myIntAttribute",
"type": "integer",
"status": "available",
"required": false,
"array": false,
"min": -9223372036854776000,
"max": 9223372036854776000,
"default": null
}
],
"indexes": []
}
]
}
@maximilianmaihoefner Thank you for reporting this. We'll look into it 🙂
FYI, min value is -9223372036854775808 and max value is 9223372036854775807.
Something seems to be rounding the values to -9223372036854776000 and 9223372036854776000….
I can confirm this problem is on the server side, not in the SDK. Same values are provided in Appwrite Console and the error above cones from axios (HTTP client) error.
Looks like the issue is a mismatch between the maximum allowed integer between size and Javascript (all numbers in js are like float, making safe max int lower). Ill work on a PR where we add support for big integers when parsing/stringifying jsons.
The problem was addressed in 0.14 release 😇 Feel free to re-open issue if after upgrading you still encounter the problem.
The problem was addressed in 0.14 release 😇 Feel free to re-open issue if after upgrading you still encounter the problem.
I am currently 0.15.1 and I am facing the same issue. No idea why (using 0.18.4 CLI)
FYI, min value is -9223372036854775808 and max value is 9223372036854775807.
Something seems to be rounding the values to -9223372036854776000 and 9223372036854776000….
I found the same issue with appwrite console. I am currently on the v1.3.4. After I created an attribute w/o specifying min and max and edited again. These two fields were filled with -9223372036854776000 and 9223372036854776000. Thus causing an error and prevent me to edit other attributes.
I'm trying to run through this Stripe tutorial and running into the same issue with the "created at" integer field. https://dev.to/appwrite/start-selling-online-using-appwrite-and-stripe-3l04
{
"key": "createdAt",
"type": "integer",
"status": "available",
"required": true,
"array": false,
"min": -9223372036854776000,
"max": 9223372036854776000,
"default": null
}
✗ Error Invalid max
param: Value must be a valid integer
appwrite deploy collection ? Which collections would you like to deploy? Orders (xxxx - orders) ℹ Info Deploying collection Orders ( xxx- orders ) ✓ Success Updated undefined (xxx ) ℹ Info Collection Orders ( orders ) already exists. ? Are you sure you want to override this collection? This can lead to loss of data! Type "YES" to confirm. YES ℹ Info Deleting indexes and attributes ... ✗ Error Invalid
min
param: Value must be a valid integer
Any solution?
Update: As pointed out above (and by Kenny in discord) "FYI, min value is -9223372036854775808 and max value is 9223372036854775807."
{
"key": "createdAt",
"type": "integer",
"status": "available",
"required": true,
"array": false,
"min": -9223372036854775808,
"max": 9223372036854775807,
"default": null
}
Still not fixed in appwrite 1.5
Thank god I knew the auto generated cli will never work well and made ci/cd scripts
As mentioned in this related discord thread, I think the problem is due to how BigNumber is stringified here:
I think we should try using JSONbig.stringify()
like we do here:
👟 Reproduction steps
appwrite login
appwrite.json
usingappwrite init --all
appwrite.json
, it should show a min/max value of-9223372036854776000
/9223372036854776000
.appwrite.json
usingappwrite deploy collection
👍 Expected behavior
Should be able to apply the created
appwrite.json
.It would also be nice if the error message could specify the allowed min/max values, or a bit more description why the passed value is invalid.
👎 Actual Behavior
$ appwrite deploy collection ? Which collections would you like to deploy? MyCollection (62212c12df87ffcd4478) ℹ Info Deploying collection MyCollection ( 62212c12df87ffcd4478 ) ℹ Info Collection MyCollection ( 62212c12df87ffcd4478 ) already exists. ? Are you sure you want to override this collection? This can lead to loss of data! Type "YES" to confirm. YES ℹ Info Updating attributes ... ✗ Error Invalid min: Value must be a valid integer
🎲 Appwrite version
Different version (specify in environment)
💻 Operating system
MacOS
🧱 Your Environment
Using Appwrite 0.13.0 but that isn't available in the 'Appwrite version'-Dropdown yet.
The Server was upgraded from 0.12.1 using the instructions at: https://appwrite.io/docs/upgrade running the Install and Data Migration commands.
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?