Back
AppwriteException: Invalid `userId` param: UID must contain at most 36 chars. Valid chars are a-z...
- 0
- Functions
- Cloud
Trying to use the users.listSessions as given here https://appwrite.io/docs/references/cloud/server-nodejs/users#listSessions here's my code
TypeScript
const result = await users.listSessions({
userId: userslist.users[0].$id
});```
I wonder why im getting this error, my userId doesnt exceed 36 chars, nor does it have underscore in the beginning , heres whats logged in ```userslist.users[0].$id```
```685add06748f633325b0```
Full Error:
```Error in purge-user-sessions function: AppwriteException: Invalid `userId` param: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore
at _Client.call (file:///usr/local/server/src/function/node_modules/node-appwrite/dist/client.mjs:293:13)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Module.default (file:///usr/local/server/src/function/src/index.js:38:20)
at async execute (/usr/local/server/src/server.js:220:16)
at async action (/usr/local/server/src/server.js:237:7)
at async /usr/local/server/src/server.js:26:5```
Edit: Add full error in the post message
TL;DR
AppwriteException is being thrown due to the `userId` param exceeding 36 chars, even though the length seems valid. The issue might be related to characters other than alphanumerics or incorrect leading underscore. Check code and potential data issues.AppwriteException: Invalid userId param: UID must contain at most 36 chars. Valid chars are a-z...
Recommended threads
- Error With iOS Apps
I keep getting the below errors for my flutter app. The clients are registered and have been. This wasn't an issue a few hours ago. AppwriteException: AppwriteE...
- Backup policies think im on free tier
Cant create more than one policy as im told to ugprade, when clicking upgrade im taken to the upgrade page which confirms im already on pro
- Cant get rid of "get started"
Not that important, but annoying. No matter what I do I cant get the "Get started" to go away, ive added a bunch of web platforms and its just stuck.