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! :)
Top comments (6)
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.
Thank you, very helpful.
Thanks this was a life saver!
Will, I find logs to be very hard to use to debug issues. Have you tried open source Sentry
short and concise, thank you!
Oh god, it should have been so obvious. Thanks for the tip anyway