How to debug a Cloud Function deployment error

wceolin profile image Will Ceolin ・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! :)

Posted on Dec 10 '19 by:

wceolin profile

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.


markdown guide

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.


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