DEV Community


How to debug a Cloud Function deployment error

Will Ceolin
Some of the things I care about: Education | Holacracy | Remote Work | Coding | Global citizen | Postcapitalism | Open source | Collaboration | Clean energy | Diversity | AI | UBI | Kindness.
・1 min read

TL;DR: Just go to the Google Cloud Console; select your project; choose a function you'd like to debug; and click on "view logs".

When deploying a Cloud Function using Firebase Tools, you might get the following error:

Error setting up the execution environment for your function. Please try deploying again after a few minutes.

It doesn't give you many details. At first, I thought it might be just a network issue because it was asking me to deploy again after a few minutes.

After failing for a couple of days, I've decided to look into the Firebase Console to see the log details. The error messages there, however, didn't help very much either.

That's because the Firebase console is just a UI connecting to services provided by the Google Cloud Platform. Their integration isn't very good yet.

However, if you go to the Google Cloud Console, you can find detailed logs which will help you to debug your code:

  • Go to the console
  • Select your project
  • Choose a function you'd like to debug
  • Click on "view logs"

That's it! Happy debugging! :)

Discussion (6)

big213 profile image

Thank you for this, this helped me identify the problem with my project. The error message told me to wait a few minutes and try again, and I probably would have just kept waiting if I didn't see this.

brudderkorn profile image

Thank you, very helpful.

amoghjrules profile image
Amogh Jahagirdar

Thanks this was a life saver!

ajjindal profile image

Will, I find logs to be very hard to use to debug issues. Have you tried open source Sentry

michelepatrassi profile image
Michele Patrassi

short and concise, thank you!

embarq profile image
Lee Igor

Oh god, it should have been so obvious. Thanks for the tip anyway

Forem Open with the Forem app