firebase / functions-samples

Collection of sample apps showcasing popular use cases using Cloud Functions for Firebase
https://firebase.google.com/docs/functions
Apache License 2.0
12.05k stars 3.84k forks source link

functions: missing required API cloudbuild.googleapis.com. Enabling now... #764

Closed YordinsonPolar closed 3 years ago

YordinsonPolar commented 4 years ago

I get this error:

Error: HTTP Error: 400, Billing account for project '385437835946' is not found. Billing must be enabled for activation of service(s) 'cloudbuild.googleapis.com,containerregistry.googleapis.com' to proceed.

jhuleatt commented 4 years ago

@Daniel-Vnzla Cloud Functions requires a billing account for Node 10 functions: https://firebase.google.com/support/faq#expandable-10

Do you have the Blaze plan enabled on your project?

TimMensch commented 3 years ago

The Spark plan allegedly supports Cloud Functions "on Node 8 only", but it also won't let us select Node 8 (because it's deprecated).

What's up with that? Shouldn't the Spark plan support the minimum allowed Node runtime?

samtstern commented 3 years ago

@TimMensch see the FAQ here: https://firebase.google.com/support/faq?authuser=0#functions-runtime

Once Node.js 8 was deprecated we decided to stop developers who were not already using it from using it because those functions will stop executing in just a few months. If you want to experiment with Functions without a credit card it's best to use the emulator.

TimMensch commented 3 years ago

@samtstern I guess the nature of my question is why isn't Node 10 allowed on Spark plans?

And if you've decided not to allow Node 10 on Spark plans, and Node 8 is permanently disabled, then why does the pricing page still claim Spark plans support Cloud Functions at all?

At the moment the pricing page is misrepresenting reality for anyone who's signing up right now.

samtstern commented 3 years ago

I agree with you about the pricing page I'll see if I can get that updated earlier. It's technically true (if you downgraded to and old CLI and used Node 8 it would let you deploy) but not meaningfully true.

Starting with Node 10 all Google Cloud Functions deploys go through Cloud Build and the images are stored in a multi-regional Cloud Storage bucket. Neither of those products is compatible with the Spark plan, so therefore neither is Cloud Functions. This is a good infrastructural decision that is bad for people trying to evaluate Firebase on the Spark plan, we wish we had a better option but we did not.

We still offer a free tier for Cloud Functions on the Blaze plan and I can tell you that in all of my personal projects I see a monthly charge of < $0.10 (mostly $0.01) for my Cloud Functions experiments. Annoying for sure but not breaking the bank.

TimMensch commented 3 years ago

This is for a client project, and I'd told the client we'd be good on the Spark plan based on the Pricing page. :(

Given the story floating around about the team that accidentally ended up with a half million dollar Google Cloud Function bill because of poor recursive crawling of pages, it makes some people a bit gun shy about possible exploding costs. Would really like to see caps on such charges, where Google would cut off the service rather than charge more than $1000 in a month, for instance.

I know the "budget" warning exists, but it checks daily. They hit a half million in GCP fees in hours, if I'm not mistaken. It also just sends emails, which I might not get for a half day or more; I'd really, really like to see a hard cap on costs to prevent accidental bankruptcy, even if I am confident that I wouldn't make a similar mistake. AWS has this same limitation, I know, but it would be really nice for small businesses to have a guaranteed liability limit on their sites; it's something that pushes some developers I know away from the big hosts to hosts like Linode that do offer a guaranteed cap on monthly costs.

That's why Spark was attractive; not because I was worried about the likely cost of a working app, but the worst-case disaster of a runaway loop that could run up a huge bill before I even noticed. If there were a "Spark+" that cost $5/month but had caps instead of potential runaway costs? I'd probably recommend that to the client, even though under Blaze it might be $1/month or less for all of the services.

samtstern commented 3 years ago

@TimMensch I don't know what else to say except that you're absolutely right. We've made negative progress in our pricing in the last year or so. We had to get rid of the Flame plan ($25 cap plan, which is what you call Spark+) and we had to move Functions out of the creditcard-less free tier.

We're pushing really hard to bring back billing caps for developers in a way that's internally sustainable. We want developers to sleep well at night. Unexpected bills are really bad for us too! They generate bad PR (I've read all of those posts) and 9/10 times we end up refunding them which is expensive for us.

We truly appreciate that people like you take the time to share your thoughts on the matter. I hope you can hang with us until we fix it!

samtstern commented 3 years ago

@Daniel-Vnzla sorry that @TimMensch and I hijacked your issue! I'm going to close this as we're pretty far from your original technical issue and @jhuleatt has suggested the correct solution.

@TimMensch if you have more to say on this topic you can always email me, my email address is in my GitHub profile.

samtstern commented 3 years ago

@TimMensch just FYI due to your feedback we went and updated the pricing page to be much more clear about the fact that Cloud Functions require Blaze:

Screen Shot 2021-01-22 at 10 40 00 AM
TimMensch commented 3 years ago

I noticed! Thanks for getting that updated!

RoyalCoder88 commented 3 years ago

Hi guys, I have Blaze plan and I still get these errors: `ensuring required API cloudfunctions.googleapis.com is enabled... i  functions: ensuring required API cloudbuild.googleapis.com is enabled...

On my second project on Firebase, any ideas why thanks in advance!

dijour commented 3 years ago

^ @samtstern Bump on @InfinityCoder88 's issue. I have the same problem. Blaze plan and getting a mysterious deploy bug. image

jhuleatt commented 3 years ago

@dijour it sounds like it may be a project-specific issue. Please contact Firebase support with the contents of firebase-debug.log.

stxwright commented 2 years ago

The information on the "Upgrade > Firebase billing plans" dialog also seems to be out of date. It currently says Usage quotas for Database, Firestore, Storage, Functions, Phone Auth, Hosting and Test Lab Given that Functions are no longer available on the Spark plan, the word "Functions" should be removed.