Skip to content
Back

Create phone token error

  • 0
  • Self Hosted
  • Auth
outrelouxhe
22 Apr, 2025, 17:06

Hi everyone, I'm getting the error below when calling the Create Phone Token. Then UA397 is the id of a user that I have just created before calling the Create Phone Token method. From a client perspective, we get an error 409 document_already_exists. I don't understand what is happening, I have already managed to get token via this method, but now I'm stuck with this issue which is impacting my production environment. For information, login with password and magic url are working but this is only this login method with OTP via SMS which is creating this issue. I'm on a self-hosted 1.6.1. Does anybody have an idea or a suggestion? Thanks a lot in advance for your support.

TypeScript
[Error] Method: POST
[Error] URL: /v1/account/tokens/phone
[Error] Type: Utopia\Database\Exception\Duplicate
[Error] Message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'UA397' for key '_uid'
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php
[Error] Line: 2406```
TL;DR
Developers are encountering a SQL error (409 document_already_exists) when trying to create a phone token for a user. The issue seems to be with a duplicate entry for user UA397. This problem impacts the OTP via SMS login method, while password and magic URL logins work fine. Possible suggestions include checking the database for any existing entries with the same user ID.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more