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

2nd gen cloud functions not deploying in any way

Hi, it’s about an hour now that I’m trying to deploy a 2nd gen cloud function and it just keeps giving me the following error message:

Build failed with status: FAILURE and message: An unexpected error occurred.

I’ve literally tried to deploy the same code as a first gen function and it perfectly works with no issues. 2nd gen cloud functions just don’t seem to work in any configuration!  I’ve also tried using the example default code and it’s surprisingly also not working. Any suggestions or ideas?

0 1 2,297
1 REPLY 1

Hi @rforzani,

Welcome to Google Cloud Community!

 

I'm sorry to hear that you're having trouble deploying your second generation Cloud Functions. There are a few things you can try to troubleshoot this issue.
  1. Make sure that you have the latest version of the Cloud Functions Emulator and the Cloud Functions Extension for Visual Studio Code installed.
  2. Check if there are any errors in your function code that might be causing the deployment to fail. You can do this by running the function locally using the Cloud Functions Emulator and debugging any errors that you encounter.
  3. Check the Cloud Functions logs for any errors or warnings that might be related to the deployment. You can view the logs in the Cloud Functions dashboard in the Google Cloud Console.
  4. If you are deploying the function using the gcloud command-line tool, make sure that you are using the correct syntax and parameters. You can refer to the documentation for the `gcloud functions deploy` command for more information.
  5. If you are still unable to deploy the function, you can try creating a new function and deploying it to see if the issue is related to the specific function code or configuration.

Thank you