HI
I am trying to deploy my java application and I am getting the follwing error
Deployment failed
ERROR: (gcloud.run.deploy) Revision 'usdh-lms-00010-gvt' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable within the allocated timeout. This can happen when the container port is misconfigured or if the timeout is too short. The health check timeout can be extended. Logs for this revision might contain more information.
Here's how my dockerfile looks
FROM openjdk:17
RUN mkdir /opt/app
ENV HOST 0.0.0.0
COPY ./japp.jar /opt/app/
COPY .env /.env
RUN chmod 777 /.env
EXPOSE 8080
CMD ["java", "-jar", "/opt/app/japp.jar"]
Have you tested this app locally? Our error message is concise and accurate, the app is not listening on the PORT. It failed to start. You can look in Cloud Logging to see if there were any startup errors.
But you need to verify that the application actually executes https://cloud.google.com/run/docs/testing/local
So even though I get this deploy failed error when I run the 'gcloud run deploy --source . ' , it is creating container image in the Artifact Directory.
So I went ahead and tried to create a job using the latest image and the job runs without an issue. Application ran successfully. What does that mean?
Also I did this in my staging environment.
> tried to create a job using the latest image
Can you please be more specific, commands and messages received? Please redact project numbers/names and PII.