Back

createSession() throws Invalid document structure: Missing required attribute "expire"

  • 0
  • Self Hosted
  • Auth
  • Web
Ryan
14 Jun, 2024, 12:48

I am running self-hosted 1.5.4 with the latest version of node-appwrite. When I try to use createSession() I get this error:

TypeScript
[Error] Timestamp: 2024-06-14T12:44:49+00:00
[Error] Method: POST
[Error] URL: /v1/users/:userId/sessions
[Error] Type: Utopia\Database\Exception\Structure
[Error] Message: Invalid document structure: Missing required attribute "expire"
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
[Error] Line: 3070

As far as I am aware I am using it correctly, passing the user ID to createSession() but it's still asking me to provide an "expire" value which doesn't seem to be supported on node-appwrite

I've also gone through the change logs for Appwrite between 1.5.4 and the latest version and couldn't see anything regarding createSession() so I didn't think my version had anything to do with issue

TL;DR
Issue: When trying to use `createSession()` in `node-appwrite`, developers are encountering the error "Invalid document structure: Missing required attribute 'expire'". Error appears in docker logs as `general_unknown`. Solution: The error is due to a missing "expire" attribute in the document structure. Even though it is not specified in the `node-appwrite` documentation, the attribute is required. Ensure the "expire" attribute is included when calling `createSession()`.
Ryan
14 Jun, 2024, 12:54

This error is appearing in the docker logs, the error returned from node-appwrite is just general_unknown

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