Back

[SOLVED]500 error while creating document

  • 0
  • Flutter
  • Cloud
Raja
24 Nov, 2023, 17:13

Im facing internal server error while the user signup process, but the user is successfully created

TL;DR
User is experiencing a 500 error when creating a document, but the document is still being successfully created. The issue seems to be related to permissions on the collections. The user has provided code for creating the document and mentions the project ID as well.
Drake
24 Nov, 2023, 17:58

what's your project ID?

Raja
24 Nov, 2023, 18:00

project ID: 654cd88c56d527c96c08

its happening while creating document on database

Raja
24 Nov, 2023, 18:03

I was creating user details document while the user signup, sign up is working fine, but when creating the document Im getting the server error but sill the document aslo created along with user

Drake
24 Nov, 2023, 18:03

so what's the code for the document creation?

Raja
24 Nov, 2023, 18:04

// Store Customer details in database Future<models.Document> createCustomer(Map map, createdBy) async { final response = databases!.createDocument( databaseId: AppWriteConstants.dbId, collectionId: AppWriteConstants.customersCollectionId, documentId: createdBy, data: { "name": map["name"], "email": map["email"], "phone": map["phone"], "createdBy": map["createdBy"], }, );

TypeScript
return response;

}

Drake
24 Nov, 2023, 18:04

500 error while creating document

Drake
24 Nov, 2023, 18:04

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.

Drake
24 Nov, 2023, 18:05

any relationships in this collection?

Drake
24 Nov, 2023, 18:06

And you said this results in a 500 error?

Raja
24 Nov, 2023, 18:06

yes 500 error but the document is created successfully

Raja
24 Nov, 2023, 18:06

and it has realtionships with other collections

Haimantika
24 Nov, 2023, 19:04

@Raja coming here from our conversation in the introduction channel. Since Steven is already helping you here, I will suggest you to wait a little longer for him to get back 😊

Raja
24 Nov, 2023, 19:04

okay

Drake
25 Nov, 2023, 03:28

The problem looks like it has to do with permissions on the relationships. What are the relationship attributes and what are the permissions on those collections

Raja
25 Nov, 2023, 14:50

[SOLVED]500 error while creating document

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