javaamazon-web-servicesspring-bootcloudcaptain

ERROR: Running application failed - Spring boot + Boxfuse/AWS


I am trying to run my Spring boot application on AWS using boxfuse. I have followed the following tutorial from Spring (section 54.4) and the Get Started from Boxfuse aswell.

When i run the following command

boxfuse run target\digigram-0.1.0.jar -env=prod

i get the following lines

Waiting for AWS to boot Instance i-74fe7fc8 and Payload to start at http://52.28.94.159:8080/ ...
WARNING: Healthcheck (http://52.28.94.159:8080/) returned 404 instead of 200. Retrying for the next 120 seconds ...
Terminating instance i-74fe7fc8 ...

And it ends with

Destroying Security Group sg-0ed6f667 ...
ERROR: Deployment of pantera160/digigram:0.0.0.1453900589995 failed in prod:Payload of Instance i-74fe7fc8 came up at http://52.28.94.159:8080/
with HTTP 404 (expected 200) => ensure your application responds with an HTTP 200 at http://52.28.94.159:8080/ or adjust the healthcheck configuration (healthcheck.path, healthcheck.timeout, ...) to fit your application
ERROR: Running pantera160/digigram:0.0.0.1453900589995 failed!

I don't understand where the problem lies. Do I have to change something in AWS or in my application or...

Any help would be greatly appreciated.

NOTE:
I am running on a free plan for AWS, might this be the problem?


Solution

  • Boxfuse ensures that a correct version of your app stays up and running and does not get replaced by a bad one. Only when a new version does pass Boxfuse's health check, does Boxfuse reassign it the application's Elastic IP. Once that is complete Boxfuse terminates the instance of the old version.

    To verify that a new version of your app comes up correctly Boxfuse expects the new version's instance's healthcheck path to return HTTP 200.

    The default healthcheck path for a regular Spring Boot application without the actuator is /. Your app currently answers 404 there instead of 200.

    You have a number of options to fix this:

    Pick either one of these options and your app will come up correctly as you would expect.