Back

Appwrite HA deployment

  • 0
  • Self Hosted
  • Functions
  • Web
LukeHagar
21 Feb, 2024, 01:43

This is what I ended up with, trying to combine the compose from appwrite, with your docs

TL;DR
Developers are experiencing an error with their Appwrite HA deployment on Docker Swarm instances. They are receiving a "User missing scope" error in the logs. The issue persists on both servers and when accessing different paths. Suggestions are made regarding using Traefik for load balancing and ensuring proper routing for Docker Swarm. Portainer is also mentioned as an orchestrating tool. A continuous conversation about troubleshooting and configuring the deployment ensues.
LukeHagar
21 Feb, 2024, 01:43

This is being deployed to a two node docker swarm

Binyamin
21 Feb, 2024, 01:44

I'm not sure about Portainer But let's see

Binyamin
21 Feb, 2024, 01:44

So you have created a load-balancer between these two servers?

Binyamin
21 Feb, 2024, 01:44

And when you're accessing each of those servers directly does it works?

LukeHagar
21 Feb, 2024, 01:45
Binyamin
21 Feb, 2024, 01:45

Yes, but you need to have something for it to hanlde it

LukeHagar
21 Feb, 2024, 01:46
TypeScript
Swarm mode has an internal DNS component that automatically assigns each service in the swarm a DNS entry. The swarm manager uses internal load balancing to distribute requests among services within the cluster based upon the DNS name of the service.

So what are you saying I should add?

Binyamin
21 Feb, 2024, 01:46

It will happen automatically only if you have something that listened for the requests, then the smart DS routing would work

LukeHagar
21 Feb, 2024, 01:46

I have traefik added

LukeHagar
21 Feb, 2024, 01:46

its deployed globally

Binyamin
21 Feb, 2024, 01:46

Tell me this

  • How do you access the Swarm? through load balancer, or what?
Binyamin
21 Feb, 2024, 01:46

Good

LukeHagar
21 Feb, 2024, 01:47

I have ngingx reverse proxy pointed at one of the servers 80/443

Binyamin
21 Feb, 2024, 01:49

Okay, Let's first try this When you're accessing each of the Docker Swarm servers IP are you able to navigate in the whole Appwrite backend?

LukeHagar
21 Feb, 2024, 01:57

No, direct IP is not working, this is the error I am getting pretty much constantly

TypeScript
[Error] Timestamp: 2024-02-21T01:53:45+00:00
[Error] Method: GET
[Error] URL: /v1/account
[Error] Type: Appwrite\Extend\Exception
[Error] Message: User (role: guests) missing scope (account)
[Error] File: /usr/src/code/app/controllers/general.php
[Error] Line: 556
Binyamin
21 Feb, 2024, 01:57

For which URL?

LukeHagar
21 Feb, 2024, 01:58

https://10.10.10.67/console/project-65d5579d86b25c8bf81f

LukeHagar
21 Feb, 2024, 01:58

https://10.10.10.67/console

LukeHagar
21 Feb, 2024, 01:58

really any path

Binyamin
21 Feb, 2024, 01:58

Okay And this is for both IPs?

LukeHagar
21 Feb, 2024, 01:59

Yes, this is happening on both severs, with the same error populating in both containers

LukeHagar
21 Feb, 2024, 01:59

seemingly at the same time

Binyamin
21 Feb, 2024, 01:59

Okay So before moving to load-balancing we need to solve this issue first

Binyamin
21 Feb, 2024, 02:00

What is the output of

TypeScript
docker service logs appwrite_appwrite

In one of your Docker Swarm instances

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