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: Creating a user throws an error #81

Closed
2 tasks done
stnguyen90 opened this issue Apr 19, 2023 · 2 comments · Fixed by appwrite/sdk-generator#660
Closed
2 tasks done

🐛 Bug Report: Creating a user throws an error #81

stnguyen90 opened this issue Apr 19, 2023 · 2 comments · Fixed by appwrite/sdk-generator#660
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@stnguyen90
Copy link
Contributor

👟 Reproduction steps

Run:

appwrite users create --verbose \
    --userId john \
    --name John \
    --email 'john@example.com' \
    --password 'Password123'

👍 Expected behavior

The user creates successfully without errors

👎 Actual Behavior

The user is created, but an error occurs:

$ appwrite users create --verbose \
    --userId johm \
    --name John \
    --email 'john@example.com' \
    --password 'Password123'
$id : john
$createdAt : 2023-04-19T19:21:31.060+00:00
$updatedAt : 2023-04-19T19:21:31.060+00:00
name : John
password : $argon2id$v=19$m=65536,t=4,p=3$T3JlY1MuMVJhQ2o1d3k0NA$0uoV2bq2atv1SHW+GnWZaHeg+rOguKGXq5ICTPq0SN0
hash : argon2
TypeError: Cannot read properties of undefined (reading 'name')
    at parse (/Users/steven/.nvm/versions/node/v16.16.0/lib/node_modules/appwrite-cli/lib/parser.js:26:52)
    at usersCreate (/Users/steven/.nvm/versions/node/v16.16.0/lib/node_modules/appwrite-cli/lib/commands/users.js:87:9)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
✗ Error Cannot read properties of undefined (reading 'name')

using json output works fine:

$ appwrite users create --verbose --json \
    --userId john \
    --name John \
    --email 'john@example.com' \
    --password 'Password123'
{
  "$id": "john",
  "$createdAt": "2023-04-19T19:25:31.168+00:00",
  "$updatedAt": "2023-04-19T19:25:31.168+00:00",
  "name": "John",
  "password": "$argon2id$v=19$m=65536,t=4,p=3$T3AxVFJSTVJuc3p2TjFPZA$o7ux4HCf/SIVHfSmnb4la3hz9Ob/7JVyiiSoeXTU/7A",
  "hash": "argon2",
  "hashOptions": {
    "type": "argon2",
    "memoryCost": 2048,
    "timeCost": 4,
    "threads": 3
  },
  "registration": "2023-04-19T19:25:31.167+00:00",
  "status": true,
  "passwordUpdate": "2023-04-19T19:25:31.167+00:00",
  "email": "john@example.com",
  "phone": "",
  "emailVerification": false,
  "phoneVerification": false,
  "prefs": {}
}
✓ Success

It seems like the parser fails on hashOptions here:

if (data[key] && data[key].constructor.name === 'BigNumber') {

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

Used CLI version 2.0.2

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

@stnguyen90 stnguyen90 added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Apr 19, 2023
@imf-ali
Copy link

imf-ali commented May 27, 2023

Hey @stnguyen90 , I would like to work on the issue. Can it be assigned to me?

@stnguyen90
Copy link
Contributor Author

@imf-ali assigned! Thanks for your interest! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants