Lightsail containers keep failing with no output

0

Hi,

This is the first time I try to use AWS Lightsail. I use it in us-east-1. I setup a nano single instance and try to run two containers - one with a Go program which talks to a database and one with Nginx front-end serving a React application.

For the sake of troubleshooting, I narrowed it down to just the Go program.

The Docker image I created on my laptop runs fine on my laptop, it can even open the connection to the database (I made the database public while debugging).

But when I push the image to Lightsail and try to deploy it, all I get is:

[1/Jan/2022:01:03:21] [deployment:8] Creating your deployment
[1/Jan/2022:01:04:31] [deployment:8] Started 1 new node
[1/Jan/2022:01:05:25] [deployment:8] Started 1 new node
[1/Jan/2022:01:06:34] [deployment:8] Started 1 new node
[1/Jan/2022:01:07:12] [deployment:8] Canceled

No matter what I try.

The container's ENTRYPOINT script prints some output (for instance, it executes env to show the environment), but I don't see it in the logs and the Go code is verbose when it starts up but I don't see the expected output in the logs either.

It also starts in about 5 seconds, including opening the connection to the database and running a few quick transactions on it, so I don't think it's a matter of slow start.

I couldn't find any other output or logs from Lightsail. The container takes about 3Mb of RAM when it runs on my laptop, way less than the 512Mb available on the Nano instance.

Similar issues happen with the container which runs Nginx. It's a custom container based on the official nginx:alpine image with my static files and extra config added to it. It runs fine on my laptop.

What am I doing wrong? Where else can I look for hints on why my deployments fail? I've been banging my head over this for three days now.

asked 2 years ago868 views
2 Answers
0

Whatever your container prints to stderr and stdout should be captured in the logs. You may want to try running your start command using CMD instead of ENTRYPOINT.

AWS
Alex
answered 2 years ago
0

If using Amazon ECR private repositories, make sure the repository is connected in the Images tab of the service deployment.

If not connected (or if you are using a different image, ehm) it will give no error but cancel the deployment.

Ondrej
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions