Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I m Not Able to Create any Function on gcp ? Firebase Deploy function error

Firebase Deploy Fails.

Coz "HTTP Error: 400, Could not create Cloud Run service ssrjivayuhomeopathyclinic. spec.template.spec.containers.resources.limits.cpu: Invalid value specified for cpu. For the specified value, maxScale may not exceed 10"

Does it get Refreshed Monthly As mentioned in Quotas ??

Firebase deploy is Failing with error!

Project is nextjs hosted in firebase, ssr in gcp.

I Deleted the Function previously, and deployed , it worked that time

But I m Stuck With the Quotas.

CAn anyone tell me , When it get refreshed or i m done here!

    functions: HTTP Error: 400, Could not create Cloud Run service ssrjivayuhomeopathyclinic. spec.template.spec.containers.resources.limits.cpu: Invalid value specified for cpu. For the specified value, maxScale may not exceed
10.
    Consider running your workload in a region with greater capacity, decreasing your requested cpu-per-instance, or requesting an increase in quota for this region if you are seeing sustained usage near this limit, see https://cloud.google.com/run/quotas. Your project may gain access to further scaling by adding billing information to your account.
    !  functions: failed to create function projects/jivayu-homeopathy-clinic/locations/asia-east1/functions/ssrjivayuhomeopathyclinic
    Failed to create function projects/jivayu-homeopathy-clinic/locations/asia-east1/functions/ssrjivayuhomeopathyclinic
like image 562
Jivayu Homeopathy Avatar asked Sep 03 '25 16:09

Jivayu Homeopathy


2 Answers

I think I had exactly the same issue, I solved it by adding maxInstances to the function like this:

exports.helloworld = onRequest(
    {timeoutSeconds: 15, cors: true, maxInstances: 10},
    (req, res) => {
      res.send("I am a function.");
    },
);
like image 77
Fabricio Espinoza Avatar answered Sep 05 '25 16:09

Fabricio Espinoza


If you are writing a function with Python for 2nd gen Cloud Functions then you can use max_instances parameter in the decorator like this:

@https_fn.on_call(max_instances=10)
def foo(req: https_fn.CallableRequest) -> any:
like image 20
Alex Pedersen Avatar answered Sep 05 '25 16:09

Alex Pedersen