-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: 500 error setting relationship to empty array #6989
Comments
@Kunalgoel9, thanks for creating this issue! 🙏🏼 A couple things to try:
|
@Kunalgoel9 I faced the same issue. It is a permission issue. My permissions were set correctly on the collection I was trying to access but not correct on the related collection. Making the permission settings match between collections resolved the issue. This was harder than it needed to be due to the API returning a generic error, but once you make this correction it will resolve the issue. A little example: Notice here I am passing an empty array to the related comments table. Problem was, I didn't have my permissions set there like I did on the main collection. Notice the permission I passed in? You need label:admin on the main table, but I didn't realize that it needed to be set on the related comments table. @stnguyen90 for visibility. |
Closing stale issue |
👟 Reproduction steps
I have two collections in my servers one is users and other is leads
I created a Relationship between them as many to one like this
![image](https://private-user-images.githubusercontent.com/67458176/277363056-7afed8f4-52d2-4396-9b37-2fb296062d00.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI3MDU2MTEsIm5iZiI6MTcyMjcwNTMxMSwicGF0aCI6Ii82NzQ1ODE3Ni8yNzczNjMwNTYtN2FmZWQ4ZjQtNTJkMi00Mzk2LTliMzctMmZiMjk2MDYyZDAwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAzVDE3MTUxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiNjJiNjkxNDk0ZWU1ZGZmNjExMzdkYTI0MjNlNjBhOGRlN2Q0MGM4YzVlYjliOGQ2M2NkZmQ1MTQ1ODBiZjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.rj9dRbu6hidVPDHhQ_lgTEjD7xSedxU29dRzOT3HOvY)
Now the issue i am facing is while creating a new account of user Server 500 error occurs
Code:
The main issue i think is i am adding users after authentication and i am not sendings the leads attribute relationship in data but i want the leads to be empty annd not bieng able to send the leads attribute as empty array
👍 Expected behavior
It Should Create a new Document white empty leads
👎 Actual Behavior
It Gives Server error 500
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Windows
🧱 Your Environment
Appwrite verision in console-->4.1.0
Appwrite library version in package.json
"appwrite": "^13.0.0"
i am using appwrite web SDK and i am currently using ReactJS as my frontend development
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: