Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Server Error, already existed ID, using relationships, create document #7054

Closed
2 tasks done
mokamhawy opened this issue Oct 31, 2023 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@mokamhawy
Copy link

mokamhawy commented Oct 31, 2023

👟 Reproduction steps

  • Create a collection A with an attribute relationship to collection B
  • Then create a doc of Collection A with attribute to id1 in collection B
  • Then create another doc of Collection A with attribute to also id1 in collection B
  • error
    image

👍 Expected behavior

To add the new document normally with its unique id

👎 Actual Behavior

image

logs

appwrite  | [Error] Method: POST
appwrite  | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents
appwrite  | [Error] Type: Appwrite\Extend\Exception
appwrite  | [Error] Message: Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.
appwrite  | [Error] File: /usr/src/code/app/controllers/api/databases.php
appwrite  | [Error] Line: 2913

🎲 Appwrite version

Version 1.4.x

💻 Operating system

Windows

🧱 Your Environment

Selfhosted
Permissions all any
appwrite Version 1.4.8

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

@mokamhawy mokamhawy added the bug Something isn't working label Oct 31, 2023
@mokamhawy mokamhawy changed the title 🐛 Bug Report: Server Error, already existed ID, using relationhips, create document 🐛 Bug Report: Server Error, already existed ID, using relationships, create document Oct 31, 2023
@mokamhawy
Copy link
Author

The issue was the relation type
Wrong ❌❌❌ => one to one
Correct ✅✅✅ => many to one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant