🐛 Bug Report: Attribute creation did not finish for too long on AppWrite-CLI 4.1.0
👟 Reproduction steps
appwrite --version
4.1.0
appwrite deploy collection
...
ℹ Info Collection APARTMENT does not exist in the project. Creating ...
✗ Error Attribute creation did not finish for too long.
👍 Expected behavior
I made a migration script and It works well
const { $id, databaseId, attributes } = GET_COLLECTION("APARTMENT");
const migrate = async () => {
await databases.createCollection(databaseId, $id, 'APARTMENT');
for (const { key, type, required, array, size } of attributes) {
console.log(`creating ${key}: type=${type} array=${array} size=${size}`)
if (type === "string") {
await databases.createStringAttribute(databaseId, $id, key, size, required, undefined, array);
}
if (type === "boolean") {
await databases.createBooleanAttribute(databaseId, $id, key, required, undefined, array);
}
await sleep(1_000);
}
}
migrate();
This worked. Looks like appwrite-cli does not reset not responding timeout after each attribute creation.
👎 Actual Behavior
The schema for the following collection should be deployed successfully. Right now It is not
{
"projectId": "64b53d0c41fcf5193b12",
"projectName": "ExampleProject",
"databases": [
{
"$id": "64c4de8e7b31179809ef",
"name": "DATABASE",
"$createdAt": "2023-09-14T10:10:35.686+00:00",
"$updatedAt": "2023-09-14T11:59:42.307+00:00",
"enabled": true
}
],
"collections": [
{
"$id": "64d4a5782854ff66e9a1",
"$permissions": [
"create(\"any\")",
"read(\"any\")",
"update(\"any\")",
"delete(\"any\")"
],
"databaseId": "64c4de8e7b31179809ef",
"name": "APARTMENT",
"enabled": true,
"documentSecurity": false,
"attributes": [
{
"key": "sanuzel_doma",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": true,
"size": 48,
"default": null
},
{
"key": "balkon_doma",
"type": "string",
"status": "available",
"error": "",
"required": false,
"array": true,
"size": 48,
"default": null
},
...
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Linux
🧱 Your Environment
Appwrite Cloud 1.4.5, Appwrite-cli 4.1.0
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
@tripolskypetr Can you please assign it to me
@CodeDrinks270 @joeyouss
Looks like I don't have permission to assign anyone to this issue. Joe, is there anything I can do to speed up the process of solving that problem?
Does the CLI still timeout?
@stnguyen90 Yeap, It still timeout. This schema will help to reproduce the error
https://gist.github.com/tripolskypetr/c1f84aa39261911291ec95addca0a839
I have received the message in my mailbox
Hi there, Thanks for getting in touch! It looks like the JSON you provided exceeds the limit of allowed attributes. You'll need to reduce the amount of attributes in the "APARTMENT" collection to be able to deploy. Currently the limit is just over 1000 attributes. Regards, Jake
Nope, Jake, You are wrong.
- The
APARTMENTcollection got only 200 attributes
- The maximum key length is 36 characters, all collection attributes does not violate this rule
- The 16kb MariaDB attribute limit is not reached (source). Total size of all attributes is
11440which is also ok
So, are there any plans to solve this issue?
For the above reasons, the problem is in the CLI. Right now the last version of appwrite-cli is 4.1.0. It published 2 months ago
@abnegate
@tripolskypetr Ah I see, yep the issue definitely looks to be in the CLI if you're only getting 200 attributes created, I will follow up with an investigation.
You will still need to reduce the number of attributes - once we resolve the CLI issue, you'll run into the column count limit noted here. The actual limit will be slightly lower since Appwrite has some internal attributes on each collection.
Looks like still not fixed. I have upgraded appwrite-cli to 4.2.0, published 6 days ago. Got same error while deploying collection with 84 attributes on Toshiba HDD appwrite installation.
Creating attributes one-by-one with that script works OK. Maybe It going to be useful to someone
The user suggests increasing the delay/timeout as creating can be much slower on a WSL2 docker on windows
https://discord.com/channels/564160730845151244/1207985484333318184/1217053962797187193
@stnguyen90 For a last half year I am trying to suggest to purge the magic constant antipattern completely
@tripolskypetr apologies for the delay. We are working on this issue and a fix will be released as part of the next version.
@christyjacob4
During the miscommunication period I implemented the alternative, see appwrite-backup-tool.
I have sent a CV for building the CLI and other dev tools for the full time. Are the Appwrite team recruiting newbies? I think my experience will be quite useful to bring dev experience to the best