Skip to content

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

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

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-commenter commented May 19, 2023

Codecov Report

❌ Patch coverage is 24.00000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.09%. Comparing base (f21c068) to head (0c495cf).
⚠️ Report is 1552 commits behind head on master.

Files with missing lines Patch % Lines
src/gcp/cloudfunctionsv2.ts 5.55% 17 Missing ⚠️
src/deploy/functions/functionsDeployHelper.ts 50.00% 1 Missing and 1 partial ⚠️
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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants