Back

[SOLVED] Appwrite internal server error while creating the document

  • 0
  • Self Hosted
  • Databases
  • Cloud
Guille
2 Nov, 2023, 13:18

I have ask for help to the core teams as they can check your account and the error you're getting, please until you get an answer

TL;DR
The user encountered an internal server error while creating a document in Appwrite. The issue was caused by missing permissions in the saved collection. The solution was to ensure that all related collections have the proper permissions. Additionally, the user's avatar URL should be a string, not a URL object. The user was provided with code to correct the issue. They should wait for further assistance from the core team.
Kishan_Verma_0304
2 Nov, 2023, 13:18

ok

Guille
2 Nov, 2023, 13:19

Oh I saw something avatarUrl is an object and not a string

Guille
2 Nov, 2023, 13:19

It should be const avatarUrl = await avatars.getInitials(user.name);

Kishan_Verma_0304
2 Nov, 2023, 13:22

but i have written the same expression

Kishan_Verma_0304
2 Nov, 2023, 13:23

@Guille

Kishan_Verma_0304
2 Nov, 2023, 13:24

'await' has no effect on the type of this expression. when i am writing await in this expression I am getting this

Guille
2 Nov, 2023, 13:31

Try this:

TypeScript
const newUser = await saveUserToDB({
      accountId: newAcc.$id,
      name: newAcc.name,
      email: newAcc.email,
      imageUrl: avatarUrl.href,
      username: user.username,
    });

I haven't used the Avatar API. If that doesn't work please post the output of avatarUrl

Kishan_Verma_0304
2 Nov, 2023, 13:33

but my imageUrl is of type url in attributes

Kishan_Verma_0304
2 Nov, 2023, 13:33

@Guille

Guille
2 Nov, 2023, 13:35

I'm not totally sure, but that should be a string URL, not a URL object

Kishan_Verma_0304
2 Nov, 2023, 13:35

ok but my avatar url is saving correctly in data base

Kishan_Verma_0304
2 Nov, 2023, 13:36

@Guille

Guille
2 Nov, 2023, 13:37

Ok so, lets wait until the team core can give more information about your issue

Kishan_Verma_0304
2 Nov, 2023, 13:37

ok please let me know

Drake
2 Nov, 2023, 14:54

Appwrite internal server error while creating the document

Drake
2 Nov, 2023, 14:55

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
2 Nov, 2023, 14:55

Also, please don't tag people like this as it can be highly disruptive. Please post and wait

Drake
2 Nov, 2023, 14:57

what's your project ID?

Kishan_Verma_0304
2 Nov, 2023, 15:00

65423467b1fa73662c59 this is my project id

Drake
2 Nov, 2023, 16:36

you have various relationships on this collection. Maybe you're missing permissions on one of the related collections

Kishan_Verma_0304
2 Nov, 2023, 16:57

solved

Drake
2 Nov, 2023, 17:13

what was the solution?

Kishan_Verma_0304
4 Nov, 2023, 04:35

in my saved collection I left the permissions

Drake
4 Nov, 2023, 06:40

[SOLVED] Appwrite internal server error while creating the 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