2

I'm very new to DevOps but I'm trying to learn some of it a bit. I'm working with Terraform, trying to get a service to run on AWS using Fargate and Docker. I've successfully set up my ECR repositories, and I walked through this tutorial on getting a service set up in Fargate. However, I'm having a bit of a problem. When I walked through the tutorial, everything worked more or less fine (there were some small issues but it was mostly pilot error), but when I tried to deploy my own application everything kind of exploded, and I can't figure out why.

  • The error I'm getting is 502 Bad Gateway.
  • The application is a Java Spring application with embedded Tomcat. I haven't changed any run configurations from the default Spring config.
  • I am able to build and Dockerize my application locally and run it through Docker on my local machine and everything works fine.
  • The only changes from the tutorial code (linked above) that I made was changing the Docker image and changing the app_port from 3000 to 8080 (I also enabled Access Logging and added an S3 bucket for that purpose)
  • The application has some auth security enabled, and when I try to hit the LB I get a login screen, so I know at least my Docker image is being pulled correctly
  • One of the errors in the task logs of my ECS instances says something about failing a health check, although I'm not able to figure out anything more than that.

To be honest I'm a total newbie at DevOps anything so I have no idea what I'm doing. Can anyone point me in some direction to help me get started?

2
  • 1
    Do you have any logs from your service?
    – schaiba
    Commented Dec 3, 2019 at 15:29
  • Based on the logs it looks like the application successfully started using Spring (it gives all the standard Spring output all the way to where it says "Started APP_NAME", and then it just exits. No error, no exception, nothing.
    – Ertai87
    Commented Dec 3, 2019 at 15:36

1 Answer 1

1

Seems like, because the application has security enabled, the health check was not able to hit the / endpoint and the health check was failing. When I removed the health check block I was able to access the application. I'll add a globally-open health check endpoint and that should fix the problem I think.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.