Back

AppwriteException: document_already_exists, Document with the requested ID already exists

  • 0
  • Flutter
tuyen3962
10 Dec, 2023, 09:37

I use uuid to create new id for one document. Everything work fine with other document but the only one document it return this exception. I don't know where the issue is. Please support me. My project id is 6568914e5e96c980d480

TL;DR
The user is experiencing an error in their app where they are getting the AppwriteException: document_already_exists error. They suspect that it may be due to a misconfigured relationship attribute. They are using UUID to create new IDs for documents and everything works fine except for one document. They request support and provide their project ID. No solution is mentioned in the thread.
Mosh Ontong
10 Dec, 2023, 09:39

I have experienced this before because of misconfigured on setting up the relationship attribute. Maybe I can help for you this, if not maybe the appwrite team can help you then.

Mosh Ontong
10 Dec, 2023, 09:40

Can I know what is the configuration of your relationship?

tuyen3962
10 Dec, 2023, 11:32

I set one relationship as one to many and other as one to one

tuyen3962
10 Dec, 2023, 11:32

But other collection work with this relationship

Mosh Ontong
10 Dec, 2023, 12:03

you have to make sure that inserting an attribute each document is unique

Mosh Ontong
10 Dec, 2023, 12:04

for example

child 123 is connected to parent A, child 123 is connected to parent B,

In that scenario this will be thrown an error it will say that your document is duplicated. Why? because the relationship could be one to one

Mosh Ontong
10 Dec, 2023, 12:05

the relationship should be Many to one

tuyen3962
11 Dec, 2023, 01:21

Oke sir. I will check it again

tuyen3962
11 Dec, 2023, 02:12

it is my fault

tuyen3962
11 Dec, 2023, 02:13

i have set the wrong relationship type for the related document. Thank you for your support.

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