Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Container Healthcheck failed. Revision 'mainapp-00009-qad' is not ready and cannot serve traffic

I'm trying to deploy my functions in Node JS. But i'm constantly facing this error.

Could not create or update Cloud Run service mainapp, Container Healthcheck failed. Revision 'mainapp-00009-qad' 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.

I also increased the memory 500Mb and timeout 600 in google cloud console. But still same.

0 1 271
1 REPLY 1

Hi @alkaabhi1919,

Welcome to Google Cloud Community!

The error suggests there's an issue with your code. Although the deployment completed, it failed at the health check step, which runs the function's global scope where libraries and clients are loaded. This could be due to exceptions, crashes, or timeouts.

You may follow any of these solutions from the Cloud Run functions troubleshooting guide:

  • Check Logs: Look at the build logs and runtime logs for more details on the error.
  • Lazy Initialization: Move some code into the request invocation to add extra logging around client libraries that might be timing out or crashing, using lazy initialization of the global variables.
  • Increase Timeout: Extend the function's timeout to allow more time for initialization and better resource allocation.
  • Entry Point Function: Ensure the source code has the right entry point function specified in the deployment settings, either through the console or gcloud.

I hope the above information is helpful.