My Cloud Run service is failing with following error.
Revision 'openfga-00016-dbg' 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.
The container works locally when i run using say docker run .. , it also works on my local minikube setup, but somehow in CloudRun in doesn’t work.
I can see that the error indicates that the Cloud Run service failed because the container did not listen on the required port (PORT=8080) or failed to respond within the timeout period. Here’s how may resolve it:
Port: Ensure your app reads the PORT environment variable instead of hardcoding a port.
Timeout: If your app takes time to start, increase the timeout using:
gcloud run deploy --timeout=600s
Logs: Make sure your app logs to stdout and stderr. Check Cloud Run logs in the console or use:
gcloud run services describe --region=
Test Locally:Run your container locally with:
docker run -e PORT=8080 -p 8080:8080
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.