Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when function deployment fails due to quota issues #5867

Merged
merged 6 commits into from
May 22, 2023

Conversation

taeold
Copy link
Contributor

@taeold taeold commented May 19, 2023

When function deployment fails due to insufficient quota on Cloud Run, the error message is difficult to understand:

i  functions: creating Node.js 18 function helloWorld(us-east4)...
⚠  functions: HTTP Error: 400, Could not create Cloud Run service helloworld. 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.

Updated error message, which we hope is clearer and actionable:

i  functions: creating Node.js 18 (2nd Gen) function helloWorld(us-east4)...
⚠  functions: Your current project quotas don't allow for the current max instances setting of 100. Either reduce this function's maxInstances, or request a quota increase on the underlying Cloud Run service at https://cloud.google.com/run/quotas.
⚠  functions: You can adjust the max instances value in your function's runtime options:
	setGlobalOptions({maxInstances: 10})

@taeold taeold requested a review from jhuleatt May 19, 2023 22:39
@taeold taeold marked this pull request as ready for review May 19, 2023 22:42
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 24.00% and project coverage change: -0.02 ⚠️

Comparison is base (f21c068) 55.10% compared to head (0c495cf) 55.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5867      +/-   ##
==========================================
- Coverage   55.10%   55.09%   -0.02%     
==========================================
  Files         333      333              
  Lines       22892    22904      +12     
  Branches     4684     4688       +4     
==========================================
+ Hits        12614    12618       +4     
- Misses       9150     9157       +7     
- Partials     1128     1129       +1     
Impacted Files Coverage Δ
src/gcp/cloudfunctionsv2.ts 59.81% <5.55%> (-1.73%) ⬇️
src/deploy/functions/functionsDeployHelper.ts 86.25% <50.00%> (-1.91%) ⬇️
src/deploy/functions/release/fabricator.ts 76.68% <100.00%> (+0.14%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@jhuleatt jhuleatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks Daniel! I think this will clear up a lot of confusion around quota issues.

@jhuleatt jhuleatt requested a review from egilmorez May 22, 2023 13:30
@taeold taeold merged commit 528aedd into master May 22, 2023
@taeold taeold deleted the dl-fn-quota branch May 22, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants