Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP Cloud functions health check failing

I am trying to deploy a function in GCP for 2 days and receive the following error each time.

OperationError: code=13, message=Function deployment failed due to a health check failure. This usually indicates that your code was built successfully but failed during test execution. Examine the logs to determine the cause. Try deploying again in a few minutes if it appears to be transient.

The Log viewer doesn't give a proper explanation of the problem. Giving the following logs continuously until the deployment fails.

"Error: function terminated. Recommended action: inspect logs for termination reason. The function cannot be initialized."

Now, the interesting fact is that the same code was working couple of weeks ago.

This issue really makes me wonder that it is a bug from GCP after the recent cloud function upgrade.

like image 551
Kshitij Bhadage Avatar asked Jul 31 '20 05:07

Kshitij Bhadage


People also ask

How do I check my GCP Health Check logs?

To view logs, go to the Logs explorer. Health check logs are indexed by instance group or network endpoint group. To see all logs, in the Resource menu, select either GCE Instance Group or Network Endpoint Group , depending on the type of backend.

Why does cloud deployment fail?

Cloud Functions deployment can fail if the entry point to your code, that is, the exported function name, is not specified correctly. Your source code must contain an entry point function that has been correctly specified in your deployment, either via Cloud console or Cloud SDK.

What is GCP health check?

Google Cloud provides health checks to determine if backends respond to traffic. This document discusses health checking concepts for Google Cloud load balancers and Traffic Director. Note: In addition to load balancing, you can use global health checks with application-based autohealing for managed instance groups.


1 Answers

I've been having the same issue. I found out part of the issue might be related to a dependency issue. In my specific case, related to the slackclient library, but it seems to come from the yarl library and the recommended fix is to define it as yarl==1.4.2

Reference: https://github.com/slackapi/python-slackclient/issues/764

like image 99
Marta R Avatar answered Sep 27 '22 22:09

Marta R