Cloud function deployment failed
I'm working on a Flutter web app that needs to send SMS and emails through Twilio and SendGrid. To handle emails, I created a Google Cloud Function that triggers every time a new document is created in a Firestore collection called apiusers. The function is supposed to send an email using SendGrid whenever a new user is added to this collection.
Could not create or update Cloud Run service sendusernotification, Container Healthcheck failed. Revision 'sendusernotification-00001-wof' 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 healtcheck timeout can be extended. Logs for this revision might contain more information.
i functions: cleaning up build files...
⚠ functions: Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/gcr/images/**/eu/gcf
Hi @Murphy_Carter,
Welcome to Google Cloud Community!
The error you're encountering during the deployment of your Cloud Function likely comes from the container failing its health check. This may occur when the deployed container doesn’t respond to the expected PORT (default is 8080) within the allocated time, or there’s an issue with the initialization process.
Here is a way to handle the problem and effectively implement your function:
Consider sharing the relevant parts of your function code or deployment command for further assistance. With these steps, your Cloud Function should deploy successfully!
I hope the above information is helpful.