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
- All function deployments fail (node 18-2...
Error: bash: /usr/local/server/helpers/build-cache.sh: No such file or directory Sidecar error: Build archive was not created at /mnt/code/code.tar.gz Scope: ...
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Selfhosted starter python function retur...
I am running a selfhosted appwrite instance. Creating a node function and executing it works just fine but when i try to execute a python starter function, i ge...