Back

[AppwriteException: Invalid `userId` param: Parameter must contain at most 36 chars. Valid chars are

  • 0
  • Android
  • React Native
  • Auth
Fayek Ahmed
29 Aug, 2024, 08:11

[I have given the code snippets of my appwrite.js file . Is there any way to solve it?

TL;DR
Developers are experiencing an AppwriteException due to an invalid `userId` parameter. The error is caused by creating a session when one is active. One developer suggests manually creating a user in the Appwrite Console under the Auth page. Another developer points out an issue with the order of parameters in setting the `newAccount` variable. The solution is to pass the `userId` as the first parameter in the code snippet provided.
Meldiron
29 Aug, 2024, 08:12

Heyyy. Notice line where you set newAccount variable. There, you pass userId, but as last oarameter. it needs to be first one

Meldiron
29 Aug, 2024, 08:13

in order userId, email, password and name

Fayek Ahmed
29 Aug, 2024, 08:13

I did this in order earlier but still no luck

Fayek Ahmed
29 Aug, 2024, 08:13

also data is not saved to user collection

Meldiron
29 Aug, 2024, 08:13

Hmm I see. Can you print the userId so we see what is the value?

Fayek Ahmed
29 Aug, 2024, 08:14

console.log it?

Meldiron
29 Aug, 2024, 08:14

Thats caused by exception. If one action fails, the function code stops. Like "return", but it is an exception

Meldiron
29 Aug, 2024, 08:14

exactly

Fayek Ahmed
29 Aug, 2024, 08:17

ok this is what I got it seems legit to me

Fayek Ahmed
29 Aug, 2024, 08:20

also this one

Meldiron
29 Aug, 2024, 08:23

Looks valid to me. Can you try to manually create user with this ID in Appwrite Console under Auth page?

Fayek Ahmed
29 Aug, 2024, 08:30

ok I can see my previously created users in auth page (Which I've found out right now🥲 ) but i cannot see it on my user collection with database. Is it normal or there's an issue with it?

Joshi
29 Aug, 2024, 08:31

Because of this

Fayek Ahmed
29 Aug, 2024, 08:44

ERROR [Error: AppwriteException: Creation of a session is prohibited when a session is active.] why this is happening

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