firebase-functions: Deploy Error: Failed to retrieve function source code

Version info

firebase-functions: 0.5.2 firebase-tools: 3.5.0 firebase-admin: 4.1.3

Steps to reproduce

Only 15 out of 17 of my functions are deploying successfully

Were you able to successfully deploy your functions?

Not exactly, I’m getting the following error since deploying my 17th function:

...
i  functions: updating function primeFunctions...
⚠  functions[orderStateChange]: Deploy Error: Failed to retrieve function source code
⚠  functions[slackPost]: Deploy Error: Failed to retrieve function source code
...
screen shot 2017-03-22 at 13 36 47

Expected behavior

Successful deployment of all 17 functions

Actual behavior

Two functions receive the above error. Deployment takes longer than usual to complete. Strangely it’s 2 different functions each time that fail to retrieve the source code.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 27 (7 by maintainers)

Most upvoted comments

@laurenzlong Awesome, I didn’t know cloud.google console was linked like that! independent deploys aren’t such a big deal with the console then. Just to note, I had no issues deploying the same functions 5 minutes later to another one of my projects. Let me know if I can help with debugging👏 Thanks again👌

Hey @ahaverty thanks for the detailed repro instructions. This is definitely a bug, and I’ll try to reproduce it on my end and figure out how to fix it. Will keep you updated on this thread. Here are the answers to your questions:

Can someone clarify if a function fails to deploy, what state is it left in (if a previous deployment was a success) are the other functions updated?

It depends on exactly how the error occurred. The best way to check is to go to https://console.cloud.google.com/functions/list. There will be check marks or x’s next to the functions depending on their current state. Clicking on the name of the function, then navigating to the “source” tab will show you the current code that’s deployed.

I could see inconsistent deployments causing issues if one function depended on another function. It looks like function deployment is independent at the moment?

Yes, the functions deployment is independent at the moment, since they happen in parallel.

Could I suggest some kind of flag like --rollback-on-fail to allow all or nothing deployments?

That’s a great suggestion and something that we’ve been thinking about. Unfortunately it’s a non-trivial effort for us due to our current technical constraints. We don’t version control your functions yet, so it would not be feasible to do roll backs at the moment. This is still a really great feature request and something that we’d like to support in the future.