0
votes

I deployed django web project using Nginx to aws ECS fargate using Jenkins and Docker. The problem is, CloudWatch log shows there is no error, but when I try to send ping or call api, it shows 503 or 502. It seems like CloudWatch log does not work when response is 500.

The only way I have in mind is make docker file allow ssh, and open port 22 of fargate, and ssh. However, using ssh to production and docker image sounds strange to me.

I want to know where I can find error log.

1
Probably the request isn't reaching the service at all, and there's a problem with whatever CloudFront/ELB/whatever you have hidden this behind.deceze
I think request reaching the service, because when I send ping it returns 200.user11896097
A "ping"? As in en.wikipedia.org/wiki/Ping_(networking_utility)? That shouldn't return an HTTP status at all…!?deceze
@deceze I meant, I made api has address /ping.user11896097

1 Answers

0
votes

It's not a good idea to ssh into a production container, but if you really want to do this, you can use SSM Session Manager.

https://github.com/aws/containers-roadmap/issues/187#issuecomment-490347856

Only your application's STDOUT/STDERR will be sent to CloudwatchLogs, so I guess it probably you have some logs that didn't stream to STDOUT/STDERR.

The only best way is you launch an EC2 and use the same image and command to start that container and go inside to check your log files.