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: Can't create new user #6249

Closed
2 tasks done
develocode777 opened this issue Sep 15, 2023 · 8 comments
Closed
2 tasks done

🐛 Bug Report: Can't create new user #6249

develocode777 opened this issue Sep 15, 2023 · 8 comments
Assignees
Labels
bug Something isn't working product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.

Comments

@develocode777
Copy link

develocode777 commented Sep 15, 2023

👟 Reproduction steps

Whatever I put in userId, email, password or name I get AppwriteException: user_already_exists. This happens only in one app, if I use the same code in a new app it works. Is there some limit per app or something?

ElevatedButton(
            onPressed: () async {
              Account accountTemp = Account(globals.appWriteClient);
              try {
                await accountTemp.create(
                    userId: ID.unique(),
                    email: '[email protected]',
                    password: 'password21312!@',
                    name: 'sdadasdada');
              } catch (e) {
                print(e);
              }
            },
            child: Text('test')),

👍 Expected behavior

Should create a new user

👎 Actual Behavior

Throws error AppwriteException: user_already_exists, A user with the same id, email, or phone already exists in this project. (409)

🎲 Appwrite version

Version 1.4.x

💻 Operating system

Linux

🧱 Your Environment

1.4.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?

ezgif com-video-to-gif-2

@develocode777 develocode777 added the bug Something isn't working label Sep 15, 2023
@develocode777
Copy link
Author

It appears that this happens when I am logged in with a specific user, with a different user the same code works.

@develocode777
Copy link
Author

I found where it comes from, if you enter a phone number in auth you can't create a user anymore.

@stnguyen90
Copy link
Contributor

@develocode777, thanks for creating this issue! 🙏🏼 It looks like this occurs when a user with a phone number has logged in and tries to create a new account. Let me talk to the team about how to proceed with this.

@stnguyen90 stnguyen90 self-assigned this Sep 15, 2023
@stnguyen90 stnguyen90 added the product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services. label Sep 15, 2023
@nick2432
Copy link

nick2432 commented Nov 2, 2023

can i work on this issue?

@Joyal-George-KJ
Copy link

I was testing Appwrite Authentication for a project and when I tried to log-in a new user (OAuth 2) that error occurred:

{
"message": "A user with the same id, email, or phone already exists in this project.",
"code": 409,
"type": "user_already_exists",
"version": "1.5.10"
}

but It was because there was already another session in there so I used the log-out function which has the current user session remove method. (deleteSession('current'))

It worked!

@fasakinhenry
Copy link

Now I am having this error and I really don't know how to solve it

@Welborn09
Copy link

I am getting this as well.

I am using React-Native Expo and have 2 Android emulators - API 35 and API 33. The API 35 doesn't have any issue creating a new user, but the API 33 recently started having problems.

version - "appwrite": "^16.1.0"
"expo": "~52.0.20"

@stnguyen90
Copy link
Contributor

When you delete a user, everything associated with the user (e.g. Identities, targets, etc) is deleted in a background job. The background job may take some time to process depending on what else is in the queue. So, you can get an error if you try to create a new account with the same email before the identity was deleted.

Make sure to delete the targets and identities first before deleting the user if you need to reuse the email before the background job runs.

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.
Projects
None yet
Development

No branches or pull requests

6 participants