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: configureHelp is not a function #93

Closed
2 tasks done
e1ke opened this issue Aug 30, 2023 · 18 comments · Fixed by appwrite/sdk-generator#707
Closed
2 tasks done

🐛 Bug Report: configureHelp is not a function #93

e1ke opened this issue Aug 30, 2023 · 18 comments · Fixed by appwrite/sdk-generator#707
Assignees
Labels
bug Something isn't working

Comments

@e1ke
Copy link

e1ke commented Aug 30, 2023

👟 Reproduction steps

I tried installing the appwrite CLI by script
https://appwrite.io/docs/command-line#installWithScript
with the following command
curl -sL https://appwrite.io/cli/install.sh | bash
The installation went successfull, I can see "May the force be with you"
After that i run appwrite -v and get an error thrown

👍 Expected behavior

It should display the appwrite version

👎 Actual Behavior

It actually shows an error in bootstrap.js:

appwrite -v                                                          
pkg/prelude/bootstrap.js:1740
      throw error;
      ^

TypeError: (intermediate value).description(...).configureHelp is not a function
    at Object.<anonymous> (/snapshot/sdk-for-cli/lib/commands/assistant.js:13:90)
    at Module._compile (pkg/prelude/bootstrap.js:1794:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.require (pkg/prelude/bootstrap.js:1719:31)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/snapshot/sdk-for-cli/index.js:18:23)
    at Module._compile (pkg/prelude/bootstrap.js:1794:22)

same error on appwrite login

🎲 Appwrite version

Version 1.3.7
sdk-for-cli version 3.0.0 (released 1h ago)
on CLI version 3.0.0, I read the following info
This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases]
but i am not even able to connect to my appwrite server. Anyway, I will try version sdk-for-cli version 2.0.2 later this evening

💻 Operating system

Linux

🧱 Your Environment

I use Linux Pop!_OS 22.04 LTS x86_64
Kernel 6.2.6-76060206-generic

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

@e1ke e1ke added the bug Something isn't working label Aug 30, 2023
@e1ke
Copy link
Author

e1ke commented Aug 31, 2023

for others: with version 2.0.2 it worked for me. I did the following:

I downloaded the script
curl -sL https://appwrite.io/cli/install.sh -o appwrite-cli-install.sh
changed its version to 2.0.2 (in function 'downloadBinary()') with
nano appwrite-cli-install.sh GITHUB_LATEST_VERSION="2.0.2"
then made it executable
chmod +x appwrite-cli-install.sh
and ran it
./appwrite-cli-install.sh

@lucasctd
Copy link

lucasctd commented Sep 1, 2023

Having a really hard time with this release of Appwrite :/ 1.4.0 was broken then 1.4.1 worked after some updates to the env file, now my functions are returning http 500 and I am not even able to use its CLI to deploy new functions...

@stnguyen90 stnguyen90 changed the title 🐛 Bug Report: TypeError on appwrite CLI 🐛 Bug Report: configureHelp is not a function Sep 1, 2023
@stnguyen90 stnguyen90 moved this to In Progress in 1.4 release Sep 1, 2023
@stnguyen90 stnguyen90 self-assigned this Sep 1, 2023
@lucasctd
Copy link

lucasctd commented Sep 1, 2023

for others: with version 2.0.2 it worked for me. I did the following:

I downloaded the script curl -sL https://appwrite.io/cli/install.sh -o appwrite-cli-install.sh changed its version to 2.0.2 (in function 'downloadBinary()') with nano appwrite-cli-install.sh GITHUB_LATEST_VERSION="2.0.2" then made it executable chmod +x appwrite-cli-install.sh and ran it ./appwrite-cli-install.sh

@e1ke did it really work for you?

v2.0.2 will not throw the error in the description of this issue but will display an error if you try to create a new function:

? What would you like to name your function? My Awesome Function
? What ID would you like to have for your function? unique()
? What runtime would you like to use? Node.js (node-18.0)
✗ Error Server Error

and in the appwrite container we'll see:

[Error] Timestamp: 2023-09-01T22:06:47+00:00
[Error] Method: POST
[Error] URL: /v1/functions
[Error] Type: Utopia\Database\Exception\Structure
[Error] Message: Invalid document structure: Unknown attribute: "schedule"
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
[Error] Line: 2619

@stnguyen90 stnguyen90 moved this from In Progress to Code Review in 1.4 release Sep 2, 2023
@e1ke
Copy link
Author

e1ke commented Sep 2, 2023

What appwrite server version are you using? I am using 1.3.7, maybe that is why it's working for me. I read somewhere, that cli appwrite Version 1.4 needs cli version 3.0.
Try to downgrade to 1.3.7 if you are newer

@kumarvivek06071999
Copy link

👟 Reproduction steps

I tried installing the appwrite CLI by script https://appwrite.io/docs/command-line#installWithScript with the following command curl -sL https://appwrite.io/cli/install.sh | bash The installation went successfull, I can see "May the force be with you" After that i run appwrite -v and get an error thrown

👍 Expected behavior

It should display the appwrite version

👎 Actual Behavior

It actually shows an error in bootstrap.js:

appwrite -v                                                          
pkg/prelude/bootstrap.js:1740
      throw error;
      ^

TypeError: (intermediate value).description(...).configureHelp is not a function
    at Object.<anonymous> (/snapshot/sdk-for-cli/lib/commands/assistant.js:13:90)
    at Module._compile (pkg/prelude/bootstrap.js:1794:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.require (pkg/prelude/bootstrap.js:1719:31)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/snapshot/sdk-for-cli/index.js:18:23)
    at Module._compile (pkg/prelude/bootstrap.js:1794:22)

same error on appwrite login

🎲 Appwrite version

Version 1.3.7 sdk-for-cli version 3.0.0 (released 1h ago) on CLI version 3.0.0, I read the following info This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases] but i am not even able to connect to my appwrite server. Anyway, I will try version sdk-for-cli version 2.0.2 later this evening

💻 Operating system

Linux

🧱 Your Environment

I use Linux Pop!_OS 22.04 LTS x86_64 Kernel 6.2.6-76060206-generic

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

bro older version works properly npm install -g [email protected]

@chexxor
Copy link

chexxor commented Sep 4, 2023

const assistant = new Command("assistant").description(commandDescriptions['assistant']).configureHelp({

The "commandDescriptions" list is missing the value "assistant", or this line can use a different named description.

I don't see a description in that list of descriptions which would match the assistant command, so we probably need to add a new item to that list with name "assistant".

@bfritscher
Copy link

bfritscher commented Sep 4, 2023

@appwrite did you test before releasing?! It seems that all the new modules do not have a commandDescriptions not only assistant, but also vcs, project, proxy, migration. And migration command has project code in it...
over 5 days without a cli fix!

@DH-555
Copy link
Member

DH-555 commented Sep 4, 2023

@bfritscher You can use the previous cli version meanwhile. It will be fixed soon

@lucasctd
Copy link

lucasctd commented Sep 4, 2023

@bfritscher You can use the previous cli version meanwhile. It will be fixed soon

It doesn't work dude. It'll throw an error when you try to create a new function, as I've described above.

@e1ke
Copy link
Author

e1ke commented Sep 4, 2023

the previous cli version itself works, but maybe not in combination with an updated appwrite 1.4.x server.
At least I am working with cli version 2.0.2 and appwrite server 1.3.7 successfully

@bfritscher
Copy link

for appwrite 1.4 I thin v 3 is required...
You can fix the cli by adding:

const commandDescriptions = {
    "assistant": "",
    "project": "",
    "proxy": "",
    "vcs": "",
    "migrations": "",

in npm\node_modules\appwrite-cli\lib\parser.js

But, for me the whole migration to 1.4.1 is broken the functions table did not migrate correctly and I cannot add them even manually, I also have other strange errors...

@joeyouss
Copy link

joeyouss commented Sep 4, 2023

The PR is merged. Thank you everyone.

@lucasctd
Copy link

lucasctd commented Sep 4, 2023

@bfritscher thanks, I forked the repo and updated the code you said, then installed it using:
npm install -g "https://github.com/lucasctd/sdk-for-cli.git#master"

it worked, but if you try to redeploy a function it'll throw an error:

Error Param "runtime" is not optional.

First deployment always run fine though.

thank you anyway.

@DH-555
Copy link
Member

DH-555 commented Sep 4, 2023

@lucasctd The error seems to have been solved with next Appwrite version

@bfritscher
Copy link

Yes, based on this https://github.com/appwrite/appwrite/pull/6125/files they fixed some thing also the fields which did not get migrated correctly, I had to manually update the database to make functions work :-(

@Kriihz77
Copy link

Kriihz77 commented Sep 4, 2023

I performed the update of the indicated branch, created the function correctly, performed my development and tried to deploy with the command: appwrite deploy function, but it is showing the following error: ✗ Error Param "runtime" is not optional.

This is my appwrite.json

{
    "projectId": "XXXXX",
    "projectName": "XXXXXX",
    "functions": [
        {
            "$id": "XXXXX",
            "name": "TeamBase",
            "runtime": "python-3.10",
            "path": "functions/EquipoBase",
            "entrypoint": "src/index.py",
            "ignore": [
                "__pypackages__"
            ],
            "execute": [],
            "events": [],
            "schedule": "",
            "timeout": 15
        }
    ]
}

@lucasctd
Copy link

lucasctd commented Sep 4, 2023

I performed the update of the indicated branch, created the function correctly, performed my development and tried to deploy with the command: appwrite deploy function, but it is showing the following error: ✗ Error Param "runtime" is not optional.

This is my appwrite.json

{
    "projectId": "XXXXX",
    "projectName": "XXXXXX",
    "functions": [
        {
            "$id": "XXXXX",
            "name": "TeamBase",
            "runtime": "python-3.10",
            "path": "functions/EquipoBase",
            "entrypoint": "src/index.py",
            "ignore": [
                "__pypackages__"
            ],
            "execute": [],
            "events": [],
            "schedule": "",
            "timeout": 15
        }
    ]
}

@criihz yeah, as I said it works only on the first deployment, if your function is already created/deployed in appwrite, it will throw that error. Seems we'll need to wait for the availability of this PR in the next release.

@stnguyen90 stnguyen90 linked a pull request Sep 5, 2023 that will close this issue
@stnguyen90 stnguyen90 moved this from Code Review to Done in 1.4 release Sep 5, 2023
@stnguyen90
Copy link
Contributor

This will be fixed in version 3.0.1 of the CLI

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
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

9 participants