Back

[SOLVED] Realtime Can't Establish a Connection

  • 0
  • Self Hosted
  • Realtime
Tanner Meade
23 Sep, 2023, 18:51

So the intended routing is traefik -> realtime, and not traefik -> appwrite_appwrite -> realtime?

TL;DR
[SOLVED] Realtime Can't Establish a Connection. Solution: Move labels to the deploy section for the appwrite and realtime services and add `--providers.docker.swarmMode=true` to the traefik command section. The issue was a discoverability/network problem between nodes. The appwrite_appwrite network is an overlay network on the swarm, but containers on other nodes don't show in docker when inspecting the network. However, manually adding the realtime service to the network showed that it was already attached. The problem was that traefik was forwarding requests to the appwrite service instead of the realtime service because it didn't
Tanner Meade
23 Sep, 2023, 19:04

@Steven Thanks for your help -- not sure how to fix this yet but that helped me narrow things down a lot ๐Ÿš€

Tanner Meade
23 Sep, 2023, 19:34

I am noticing that the realtime isn't in any of the docker networks when I inspect them. I would think it should be in the Containers when inspecting the appwrite_appwrite network. The realtime service does have the appwrite network in the docker-compose.yml.

Tanner Meade
23 Sep, 2023, 19:36

So my theory right now is that traefik is forwarding the requests to the appwrite service instead of the realtime service because it doesn't have the realtime service in it's networks, dispite the docker_compose.yml having the traefik prefix /v1/realtime setup (so it defaults back to the appwrite traefik prefix / because that does still match).

Tanner Meade
23 Sep, 2023, 19:37

Now to see if I can figure out why realtime isn't in the appwrite network even though I've specified it should be in the docker_compose.yml.

Tanner Meade
23 Sep, 2023, 19:52

The realtime service is already attached to the appwrite_appwrite network already, but not showing up in the inspect output.

Drake
23 Sep, 2023, 20:51

Weird...

Tanner Meade
23 Sep, 2023, 20:52

Ya when I try to manually add realtime to the network using docker service update --network-add appwrite_appwrite appwrite_appwrite-realtime it says service is already attached to network appwrite_appwrite

Tanner Meade
23 Sep, 2023, 21:05

When I inspect the container on the server realtime is running on, the container has the network with an ip address.

Tanner Meade
23 Sep, 2023, 21:05

ah, when I inspect the appwrite_appwrite network on that server it has the realtime container in the network

Tanner Meade
23 Sep, 2023, 21:07

Ya, so docker network inspect appwrite_appwrite will only have the containers on that server.

Tanner Meade
23 Sep, 2023, 21:08

Which realtime and traefik are on different servers

Tanner Meade
23 Sep, 2023, 21:10

The appwrite_appwrite network is setup as an overlay network on the swarm, so it should be able to communicate between nodes

Drake
23 Sep, 2023, 21:10

Are you having problems after upgrading to 1.4?

Tanner Meade
23 Sep, 2023, 21:10

No, this is still 1.3.8

Drake
25 Sep, 2023, 05:04

It might be something with the swarm network or something

Tanner Meade
25 Sep, 2023, 05:08

From what I can tell, an overlay network is the type to use which is what the network is. However services/containers on other nodes donโ€™t show in docker when inspecting the network. When I inspect the realtime container on the node it does say it is attached to the network and inspecting the network on that node does show the container. Right now, Iโ€™m having to figure out how docker networks work really well so I know how to debug this. Also trying to compare a working non-swarm Appwrite instance.

Tanner Meade
25 Sep, 2023, 05:12

I think my theory that traefik couldnโ€™t find the service might be wrong, or at least the reason I was thinking that might be inaccurate.

Drake
25 Sep, 2023, 21:32

ya..im not sure how the networks work especially with swarm

Tanner Meade
25 Sep, 2023, 23:25

If I put realtime on the same docker node as traefik + appwrite, it works. So it must be a discoverability/network type of issue between nodes.

Tanner Meade
26 Sep, 2023, 19:55

Figured it out! Via this reddit thread and the traefik docker docs:

Tanner Meade
26 Sep, 2023, 19:56

I needed to move the labels to the deploy section for the appwrite and realtime services, and I needed to add - --providers.docker.swarmMode=true to the traefik command section.

Tanner Meade
26 Sep, 2023, 19:56

[SOLVED] Realtime Can't Establish a Connection

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