Back

Email already exists in database

  • 0
  • Databases
  • Web
  • Cloud
cryptobitez
31 Jan, 2025, 23:33

I deployed a website with a waiting list, it sends the user email and name to the appwrite DB. It works well locally but when i deployed the website, anyone that signs up gets an error; 'Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.' This is as simple as it gets. Just a form with 3 fields sending data straight to a DB (unqiue index on email). I think this is an issue with appwrite, why would this work locally and not in production??

TL;DR
Issue: Error message 'Document with the requested ID already exists' when users sign up on deployed website, but not locally. Solution: The error is not related to the ID, but rather to the uniqueness constraint on the email field in the database. You should handle this constraint by checking if the email already exists in the database before trying to insert it. This will prevent the error from occurring.
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