如果您的项目在使用服务时超过了其最大配额值, Google Cloud会根据您访问该服务的方式返回错误:
如果在发出 API 请求时超出了配额值, Google Cloud 会返回 HTTP 413 REQUEST ENTITY TOO LARGE 状态代码。请注意,在生产环境中使用 BigQuery 旧版流式 API 时,如果您的 HTTP 请求大于 10 MB,您可能会收到 413 REQUEST ENTITY TOO LARGE 状态代码。如果每秒传输的数据量超过 300 MB,您也可能会收到此错误。如需了解详情,请参阅流式插入。
如果在发出 HTTP/REST 请求时超出了配额值, Google Cloud 会返回 HTTP 429 TOO MANY REQUESTS 状态代码。
如果在使用 gRPC 时超出配额值, Google Cloud 会返回 ResourceExhausted 错误。此错误的显示方式取决于该服务。
如果在使用 Google Cloud CLI 命令时超出配额值,gcloud CLI 会输出“已超出配额”错误消息并返回退出代码 1。
如果您在服务发布期间收到 QUOTA_EXCEEDED 消息,请参阅以下部分。
在服务发布期间超出配额值
Google Cloud 有时会更改资源和 API 的默认配额值。这些更改逐步进行,这意味着在发布新的默认配额期间,Google Cloud 控制台中显示的配额值可能无法反映您可以使用的新配额值。
如果配额发布正在进行,您可能会收到一条错误消息,其内容为 The future limit is the new default quota that will be available after a
service rollout completes.。如果您看到此错误消息,则表示引用的配额值和未来值正确无误,即使出现在 Google Cloud 控制台中的内容有所不同。
PERMISSION_DENIED: Your application is authenticating by using local Application Default Credentials.
The cloudquotas.googleapis.com API requires a quota project, which is not set by default.
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-06。"],[[["\u003cp\u003eQuota errors can occur due to exceeding quota values, rate quotas, or incorrect project quota settings, each with distinct error codes and messages.\u003c/p\u003e\n"],["\u003cp\u003eDuring service rollouts, the quota value displayed in the Google Cloud console might differ from the actual available quota, and the system will provide a \u003ccode\u003eQUOTA_EXCEEDED\u003c/code\u003e error with a \u003ccode\u003efutureLimit\u003c/code\u003e value.\u003c/p\u003e\n"],["\u003cp\u003eAPI request errors such as \u003ccode\u003eUser credentials not supported by this API\u003c/code\u003e, \u003ccode\u003eAPI not enabled in the project\u003c/code\u003e, or \u003ccode\u003eNo quota project set\u003c/code\u003e often indicate issues with the quota project configuration.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the gcloud CLI, ensure it's properly installed, initialized, and updated, and the quota project must be set correctly to avoid errors like \u003ccode\u003ePERMISSION_DENIED\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo mitigate errors, users can set up custom alerts for specific quota errors, view audit logs for \u003ccode\u003eQUOTA_EXCEEDED\u003c/code\u003e messages, and request a quota adjustment if necessary.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot quota errors\n\nYou might receive quota errors for a number of reasons, such as exceeding quota\nvalues or not setting the quota on a project correctly. If you want to be alerted\nwhen errors happen, you can create custom alerts for specific\nquota errors, as described in\n[Set up quota alerts](/docs/quotas/set-up-quota-alerts).\n\nExceeding rate quotas\n---------------------\n\nRate quotas reset after a predefined time interval that is specific to each\nservice. For more information, see the quotas documentation for the specific\nservice.\n\nExceeding quota values\n----------------------\n\nIf your project exceeds its maximum quota value while using a service, Google Cloud\nreturns an error based on how you accessed the service:\n\n- If you exceed a quota value with an API request, Google Cloud returns an HTTP `413 REQUEST ENTITY TOO LARGE` status code. Note that when using the BigQuery legacy streaming API in a production environment, you may receive a `413 REQUEST ENTITY TOO LARGE` status code if your HTTP requests are larger than 10 MB. You may also receive this error if you exceed 300 MB per second. For more information see [Streaming inserts.](/bigquery/quotas#streaming_inserts)\n- If you exceeded a quota value with an HTTP/REST request, Google Cloud returns an HTTP `429 TOO MANY REQUESTS` status code.\n- If you exceed a quota for Compute Engine, Google Cloud typically returns an HTTP `403 QUOTA_EXCEEDED` status code, whether it was from API, HTTP/REST, or gRPC. If the quota is a rate quota, then `403 RATE_LIMIT_EXCEEDED` is returned.\n- If you exceeded a quota value using [gRPC](https://grpc.io), Google Cloud returns a `ResourceExhausted` error. How this error appears to you depends on the service.\n- If you exceeded a quota value using a Google Cloud CLI command, the gcloud CLI outputs a quota-exceeded error message and returns with the exit code `1`.\n- If you received a `QUOTA_EXCEEDED` message during a service rollout, see the following section.\n\nExceeding quota values during a service rollout\n-----------------------------------------------\n\nGoogle Cloud sometimes changes the default quota values for resources\nand APIs. These changes take place gradually, which means that during the\nrollout of a new default quota, the quota value that appears in the Google Cloud console\nmight not reflect the new quota value that is available to you.\n\nIf a quota rollout is in progress, you may receive an error message that states\n`The future limit is the new default quota that will be available after a\nservice rollout completes.` If you see this error message, the cited quota value\nand future value are correct, even if what appears in the Google Cloud console\nis different.\n\n- For additional information, [view the audit logs](/logging/docs/audit#view-logs)\n and look for a `QUOTA_EXCEEDED` message.\n\n \"status\": {\n ...\n \"message\": \"QUOTA_EXCEEDED\",\n \"details\": [\n {\n ...\n \"value\": {\n \"quotaExceeded\": {\n ...\n \"futureLimit\": \u003cvar translate=\"no\"\u003eFUTUREVALUE\u003c/var\u003e\n }\n }\n }\n ]\n },\n\n- To view charts that show current and peak usage,\n in the Google Cloud console, go to the\n [**IAM \\& Admin \\\u003e Quotas \\& System Limits**](https://console.cloud.google.com/quotas?project=_)\n page and then click monitoring**Monitoring**.\n You might need to go to the end of the table.\n\n- If you need more quota, you can\n [request a quota adjustment](/docs/quotas/help/request_increase).\n\nExceeding project quota\n-----------------------\n\nFor more information about requesting additional *project quotas* , refer to the\n[Project quota requests](https://support.google.com/cloud/answer/6330231)\nsupport article.\n\nAPI error messages\n------------------\n\nIf your quota project (also called a billing project) isn't set correctly, API\nrequests might return error messages that are similar to the following:\n\n- `User credentials not supported by this API`\n- `API not enabled in the project`\n- `No quota project set`\n\nThese and other errors can often be fixed by setting the quota project.\nFor more information, see [Quota project overview](/docs/quotas/quota-project).\n\nGoogle Cloud CLI errors\n-----------------------\n\nThis section describes common issues encountered when getting started with the\nGoogle Cloud CLI (gcloud CLI).\n\n### Install and initialize\n\nTo use the gcloud CLI for Cloud Quotas, be sure to install and\ninitialize components:\n\n1. [Install](/sdk/docs/install) the gcloud CLI.\n\n If you're using Cloud Shell, you can skip this step because\n gcloud CLI comes pre-installed.\n2. [Initialize](/sdk/docs/initializing) the gcloud CLI.\n\n3. [Install the beta component](/sdk/docs/components#alpha_and_beta_components)\n by running the following command:\n\n gcloud components install beta\n\n### Set your quota project\n\nIf you haven't set your quota project, gcloud CLI commands might\nreturn an error like the following: \n\n PERMISSION_DENIED: Your application is authenticating by using local Application Default Credentials.\n The cloudquotas.googleapis.com API requires a quota project, which is not set by default.\n\nTo resolve this issue, add the `--billing-project` flag on your\ngcloud CLI command to explicitly set the quota project, or rerun\n`gcloud config set billing/quota_project CURRENT_PROJECT` to set the quota project\nas the current project.\n\nFor more information, see the following:\n\n- [Set the quota project programmatically](/docs/quotas/set-quota-project#set-project-programmatically).\n- [Set the billing project](/sdk/gcloud/reference#--billing-project) through the gcloud CLI.\n\n### Update gcloud CLI components\n\nIf you receive an error that the quotas command contains an `Invalid choice`,\nyou might have an older version of the gcloud CLI installed.\nUpdate the gcloud CLI components with the following command: \n\n gcloud components update\n\nFor more details about `gcloud beta quotas` commands and flags, see the\n[gcloud beta quotas](/sdk/gcloud/reference/beta/quotas)\nsection of the Google Cloud CLI reference."]]