Engineering Elixir Applications:

@elliefairholm and @Gilacost

Title: Engineering Elixir Applications: Docker swarm services don’t come up (page 261)

Hi, I’m really enjoying the book and getting great practice. I’m to the point of setting up CD. But when I try to deploy to the stack in AWS I get messages similar to:

image postgres:15.2 could not be accessed on a registry to record
its digest. Each node will access postgres:15.2 independently,
possibly leading to different nodes running different
versions of the image.

Am I missing a step? Is the book missing a step? Have I messed up my environment in some way?

Doing a ps on each service, including the Postgres instance (which is fairly foolproof) shows “No such image: postgres:15.2”. So I assume this is an issue authenticating with the container repo, but I don’t know why

More: if I try to docker login from the swarm main EC2 I get:

Error response from daemon: Get "https://ghcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

More! I can’t even ping google from the host. Maybe I have a problem with my egress

Finally - FYI I had the protocol on the terraform egress block for the security group set to “tcp”, probably from copypasta from the other blocks. As you have in the book it should be “-1”, although I don’t quite understand that yet.

Problem solved.

2 Likes

I love this post, and I’m glad you managed to solve the error!

Setting the egress protocol to “-1” means that you are allowing all types of protocols (tcp, http etc.). We set the egress rule to be “-1” to simplify some configurations in the book to keep things concise and accessible, but in a real-world you could definitely fine tune this a bit more.

Hope you enjoy the rest of the book :slight_smile: