DEV Community

Will Ceolin
Will Ceolin

Posted on • Edited on

How to debug a Cloud Function deployment error


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.
Enter fullscreen mode Exit fullscreen mode

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! :)


Follow me on Twitter

Top comments (6)

Collapse
 
big213 profile image
big213

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.

Collapse
 
brudderkorn profile image
Brudderkorn

Thank you, very helpful.

Collapse
 
amoghjrules profile image
Amogh Jahagirdar

Thanks this was a life saver!

Collapse
 
ajjindal profile image
ajjindal

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

Collapse
 
michelepatrassi profile image
Michele Patrassi

short and concise, thank you!

Collapse
 
embarq profile image
Lee Igor

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