Back

Self Hosting accessing AppWrite Console localhost/v1/account 401

  • 0
  • Self Hosted
  • Auth
  • Web
EatSleepCode
4 Feb, 2025, 11:14

Hey folks,

I'm building out an application that helps people design offshore windfarms and looking to leverage AppWrite. I've used the hosted version for a couple of React Native apps and it's been great.

This new app needs to be vendor agnostic as it might be deployed inside a customers cloud for data compliance so I'm developing locally to make sure I can deply the docker compose anywhere (though our multitenant site will be on AppWrite cloud).

Issue:

  • I get a 401 when trying toSign In to the locally running AppWrite console

Steps to recreate:

  • Using a vscode Dev Container (mounted from a WSL2 folder on a Windows system)
  • Run through the self host setup instructions
  • Use the docker compose approach
  • Copy the compose file
  • Copy the Env file
  • Run docker compose up -d --build
  • Sign Up with first user
  • Log Out
  • Try to Sign In again

Expected outcome:

  • Log In to work

Actual:

  • AppWrite console web app returns: GET http://localhost/v1/account 401 (Unauthorized)
  • Sign In button remains disabled permanently
  • Trying to visit the console main page redirects to Sign In
  • The AppWrite container logs: [Error] Message: User (role: guests) missing scope (account)

AFAICT the setup appears to be correct, am I missing some step or config nuance along the way? Any help gratefully received because AppWrite is awesome!!

TL;DR
Issue: Developers receive a 401 error when trying to Sign In to the locally running AppWrite console. The Sign In button remains disabled permanently, and attempting to access the console main page redirects to the Sign In page. The AppWrite container logs show an error message regarding missing scope (account). Solution: The error is due to a missing scope in the user's role. Developers should review their setup and ensure the user role has the necessary scope (account) assigned to it. This should resolve the 401 unauthorized error and allow for successful Sign In to the AppWrite console.
EatSleepCode
4 Feb, 2025, 11:16

Self Hosting accessing AppWrite Console localhost/v1/account 401

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