appwrite icon indicating copy to clipboard operation
appwrite copied to clipboard

🐛 Bug Report: Can't create new user

Open develocode777 opened this issue 2 years ago • 5 comments
trafficstars

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

  • [x] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

ezgif com-video-to-gif-2

develocode777 avatar Sep 15 '23 09:09 develocode777

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

develocode777 avatar Sep 15 '23 14:09 develocode777

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

develocode777 avatar Sep 15 '23 14:09 develocode777

@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 avatar Sep 15 '23 19:09 stnguyen90

can i work on this issue?

nick2432 avatar Nov 02 '23 04:11 nick2432

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!

joyalgeorgekj avatar Aug 26 '24 10:08 joyalgeorgekj

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

fasakinhenry avatar Oct 27 '24 16:10 fasakinhenry

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"

Welborn09 avatar Jan 11 '25 14:01 Welborn09

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 avatar Jan 18 '25 23:01 stnguyen90