Skip to content

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

Closed as not planned
Closed as not planned

Description

@develocode777

👟 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

Activity

  1. added
    bug
    on Sep 15, 2023
  2. develocode777 commented on Sep 15, 2023

    @develocode777
    Author

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

  3. develocode777 commented on Sep 15, 2023

    @develocode777
    Author

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

  4. stnguyen90 commented on Sep 15, 2023

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

  5. self-assigned this
    on Sep 15, 2023
  6. added
    product / auth
    on Sep 15, 2023
  7. nick2432 commented on Nov 2, 2023

    @nick2432

    can i work on this issue?

  8. joyalgeorgekj commented on Aug 26, 2024

    @joyalgeorgekj

    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!

  9. fasakinhenry commented on Oct 27, 2024

    @fasakinhenry

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

  10. Welborn09 commented on Jan 11, 2025

    @Welborn09

    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"

  11. stnguyen90 commented on Jan 18, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugproduct / auth

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions