Docker based application cannot be redeployed successfully (502 Gateway Error)
team-strive-admin
PROOP

2 years ago

Hello everybody,
Since a month we have a issue with one specific service within our production environment. After the first request the deployed instance crashes.
The instance is "just" a Java (Spring) application living inside a Docker container. The codebase as the corresponding Dockerfile didn't
changed.

FROM maven:3-amazoncorretto-21 AS build
COPY . /home/app
RUN mvn -f /home/app/pom.xml clean package

FROM amazoncorretto:21
COPY --from=build /home/app/bot/target/bot-1.0.0-SNAPSHOT.jar /usr/local/lib/stage.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/usr/local/lib/stage.jar", "--spring.profiles.active=prod"]

The railway.json file:

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "DOCKERFILE"
  }
}

15 Replies

team-strive-admin
PROOP

2 years ago

a2d3c3f9-f5e5-4456-bb12-a749673c197d


2 years ago

have you pointed the domain to the correct port?


team-strive-admin
PROOP

2 years ago

Yes, we changed nothing.


2 years ago

please send the domain in question


team-strive-admin
PROOP

2 years ago


2 years ago

application failed to respond means your application failed to respond.

please check that you are listening on the host 0.0.0.0 and your domain is pointing to the correct port.


team-strive-admin
PROOP

2 years ago

We checked. Nothing changed in the configuration. The application listens to 0.0.0.0 and points to :8080.


team-strive-admin
PROOP

2 years ago

Also the instance crashes without any error in the Observability log.


2 years ago

if it's crashing without any logs that means your application is not logging anything


team-strive-admin
PROOP

2 years ago

It should 😄 And it has before^^ Was there any changes to how docker builds are treated?


2 years ago

there has not been, this would be an application level issue, as long as your application prints logs unbuffered to stdout / stderr you will see them in the deploys logs


team-strive-admin
PROOP

2 years ago

Yes, that was the case two weeks ago. It is even possible to run the docker container locally.
Could there be something else that we miss in the railway configuration?


2 years ago

yes that possible, I would focus on adding more verbose logging so you can find out why your application is crashing


team-strive-admin
PROOP

2 years ago

Okay, we will try our best^^ Thank you anyway 🙂


2 years ago

sorry i couldn't give you the answer, but railway doesn’t have any more observability into what your code does or doesn’t do than you would.


Loading...