Hi!
I have a Cloud Function Gen2 that failed to deploy when it was first created. After fixing the issue, the Function is now perpetually stuck in a state of "failed to deploy"
There are no error messages in the logs. The Function does update and the underlying Cloud Run instance updates and runs successfully too. The Function logs tell me “Default STARTUP TCP probe succeeded after 1 attempt”.
The function does update if I redeploy. But I can’t redeploy from the UI as the deploy button is greyed out.
I’ve got about 8 other functions that all seem to work, it’s just this 1 that is stuck without any added information about why.
I’ve tried deleting it and recreating it but it’s still stuck.
What can i do to fix this?
Hi @DustinSilk,
Welcome to the Google Cloud Community!
We need to get to the root of what's causing the Cloud Function to be stuck in "failed to deploy"
To monitor your runtime logs, you can view it in the Cloud Logging UI. You can refer to Viewing Runtime Logs which leads to viewing your logs in the Google Cloud CLI.
To view logs via the command line, you can use the command below to view logs, we will add the --gen2 flag as you are using 2nd gen Cloudn fucntion:
gcloud functions logs read --gen2
to view the logs for a specific function, include the function name like so:
gcloud functions logs read FUNCTION_NAME --gen2
You can also view runtime logs for Cloud Functions in the Google Cloud Console.
Check out this GCC post about a Cloud Function being stuck and failed deployment, as you might have the same issue.
Basically what you will do here is go to the storage container and restore the code version to the oldest version. Which then leads the function build to fail so that you can Edit and Redeploy it.
If the above options don't work, you can contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!
Thanks for the response! I've been through that issue and its slightly different to my issue:
It seems like the only way to contact support is to subscribe to Googles support program, which is a little unfair considering there's clearly some kind of bug/issue that is out of my control.