Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ› Bug Report: Attribute creation did not finish for too long on AppWrite-CLI 4.1.0 #135

Open
2 tasks done
tripolskypetr opened this issue Oct 15, 2023 · 11 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@tripolskypetr
Copy link

tripolskypetr commented Oct 15, 2023

πŸ‘Ÿ 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?

  • I checked and didn't find similar issue

🏒 Have you read the Code of Conduct?

@tripolskypetr tripolskypetr added the bug Something isn't working label Oct 15, 2023
@CodeDrinks270
Copy link

@tripolskypetr
Can you please assign it to me

@tripolskypetr
Copy link
Author

@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?

@stnguyen90 stnguyen90 self-assigned this Oct 16, 2023
@stnguyen90
Copy link
Contributor

Does the CLI still timeout?

@tripolskypetr
Copy link
Author

tripolskypetr commented Oct 18, 2023

@stnguyen90 Yeap, It still timeout. This schema will help to reproduce the error

https://gist.github.com/tripolskypetr/c1f84aa39261911291ec95addca0a839

@tripolskypetr
Copy link
Author

tripolskypetr commented Nov 3, 2023

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.

  1. The APARTMENT collection got only 200 attributes

ezgif-3-5e0143a6c1 (1)

  1. The maximum key length is 36 characters, all collection attributes does not violate this rule

image

  1. The 16kb MariaDB attribute limit is not reached (source). Total size of all attributes is 11440 which is also ok

image

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

screenshot

@abnegate

@abnegate
Copy link
Contributor

abnegate commented Nov 3, 2023

@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.

@tripolskypetr
Copy link
Author

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.

image

Creating attributes one-by-one with that script works OK. Maybe It going to be useful to someone

@stnguyen90
Copy link
Contributor

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

@tripolskypetr
Copy link
Author

@stnguyen90 For a last half year I am trying to suggest to purge the magic constant antipattern completely

@stnguyen90 stnguyen90 transferred this issue from appwrite/appwrite Jul 12, 2024
@christyjacob4
Copy link
Member

@tripolskypetr apologies for the delay. We are working on this issue and a fix will be released as part of the next version.

@tripolskypetr
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

No branches or pull requests

6 participants