whitebear
whitebear

Reputation: 12433

How to check the log of failed deployment by docker-compose on fargate

I deploy my project to aws ecs with this command.

docker compose -f docker-compose.fargate.yml up

version: "3.9"
   
services:

  admindjango:
    image: 6781xxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/st_admin_site:latest
    ports:
      - "8011:8011"
    restart: always
    command: uwsgi --http :8011 --module admin_site.wsgi

  nginx:
    image: 6781xxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/st_nginx:latest
    ports:
      - '80:80'
    depends_on:
      - admindjango

At first it looks well but failed at last.

And stack is also deleted.

I can guess there are some errors in docker, however stack is deleted, so I can't find any clue about what happened. Is there any good way to check log or something?

(base) whitebear$ docker compose -f docker-compose.fargate.yml up
WARNING services.restart: unsupported attribute      
WARNING services.scale: unsupported attribute        
WARNING services.scale: unsupported attribute        
[+] Running 20/20
 ⠿ monitor-admin                    DeleteComplete                                                                                                                      358.5s
 ⠿ NginxTaskExecutionRole            DeleteComplete                                                                                                                      242.0s
 ⠿ CloudMap                          DeleteComplete                                                                                                                      352.6s
 ⠿ Cluster                           DeleteComplete                                                                                                                      306.6s
 ⠿ LogGroup                          DeleteComplete                                                                                                                      308.7s
 ⠿ NginxTCP80TargetGroup             DeleteComplete                                                                                                                      242.0s
 ⠿ DefaultNetwork                    DeleteComplete                                                                                                                      306.6s
 ⠿ AdmindjangoTaskExecutionRole      DeleteComplete                                                                                                                      309.7s
 ⠿ LoadBalancer                      DeleteComplete                                                                                                                      307.6s
 ⠿ AdmindjangoTCP8011TargetGroup     DeleteComplete                                                                                                                      307.6s
 ⠿ Default80Ingress                  DeleteComplete                                                                                                                      229.9s
 ⠿ DefaultNetworkIngress             DeleteComplete                                                                                                                      228.9s
 ⠿ Default8011Ingress                DeleteComplete                                                                                                                      228.9s
 ⠿ NginxTaskDefinition               DeleteComplete                                                                                                                      211.9s
 ⠿ AdmindjangoTaskDefinition         DeleteComplete                                                                                                                      276.9s
 ⠿ AdmindjangoServiceDiscoveryEntry  DeleteComplete                                                                                                                      257.6s
 ⠿ NginxServiceDiscoveryEntry        DeleteComplete                                                                                                                      192.3s
 ⠿ NginxTCP80Listener                DeleteComplete                                                                                                                       87.4s
 ⠿ AdmindjangoTCP8011Listener        DeleteComplete                                                                                                                      152.8s
 ⠿ AdmindjangoService                DeleteComplete                                                                                                                      142.9s
AdmindjangoService EssentialContainerExited: Essential container in task exited

Upvotes: 1

Views: 922

Answers (1)

mreferre
mreferre

Reputation: 6073

We have recently introduced the ability to avoid the automatic rollback in CFN but docker doesn't leverage that (AFAIK).

The best option in that case (that's how I do it anyhow) is to monitor closely the deployment and check the task log. The CFN message says that the essential container exited. This means that either the nginx or the admindjango containers (that are deployed in separate ECS services and separate ECS tasks under the same ECS cluster) did not stabilize for the long run and exited. You need to locate them both in the ECS console and explore the container logs to understand what happened (which one failed and why).

I assume this compose comes up just fine locally, I guess?

Upvotes: 1

Related Questions