Ошибка 403 rate limit exceeded

To protect users and Google systems from abuse, applications that use OAuth and Google Identity have certain quota restrictions based on the risk level of the OAuth scopes an app uses. These limits include the following:

  • A new user authorization rate limit that limits how quickly your application can get new users.
  • A total new user cap. To learn more, see the Unverified apps page.

When an application exceeds the rate limit, Error 403: rate_limit_exceeded is displayed to users, like in the screenshot below:

Error 403 Authorization Error window

Application developers

As a developer of an application, you can view the current user authorization grant rate (or token grant rate) in the Google API Console OAuth consent screen page before your application displays this error.

If you see that your application will reach the rate limit soon via the Google API Console or see this error being displayed, you should take action to improve your application’s user experience. You can request a rate limit quota increase for the application. Please expect a response in 5 business days.

OAuth rate limit quotas

 

Applicable apps

Quota

Appeal

New user authorization rate limit

Apps that request access to user data, including verified apps

Dependent on application history, developer reputation, and riskiness

Request a rate limit quota increase

To learn more about the total new user cap, see the Unverified apps page.

Was this helpful?

How can we improve it?

Likely something to do with pytorch=1.9:

  • Works with python=3.7 and pytorch=1.7
Python 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 16:07:37) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.7.0'
>>> model = torch.hub.load('pytorch/vision:v0.10.0', 'resnet50', pretrained=True, force_reload=True)
Downloading: "https://github.com/pytorch/vision/archive/v0.10.0.zip" to /home/ml/farleylai/.cache/torch/hub/v0.10.0.zip
  • Works with python3.9 and pytorch=1.7.1 and 1.8.1.
Python 3.9.5 (default, Jun  4 2021, 12:28:51) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
import torch
>>> torch.__version__
'1.7.1'
>>> model = torch.hub.load('pytorch/vision:v0.10.0', 'resnet50', pretrained=True, force_reload=True)
Downloading: "https://github.com/pytorch/vision/archive/v0.10.0.zip" to /home/ml/farleylai/.cache/torch/hub/v0.10.0.zip
Python 3.9.5 (default, Jun  4 2021, 12:28:51) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.8.1'
>>> model = torch.hub.load('pytorch/vision:v0.10.0', 'resnet50', pretrained=True, force_reload=True)
Downloading: "https://github.com/pytorch/vision/archive/v0.10.0.zip" to /home/ml/farleylai/.cache/torch/hub/v0.10.0.zip
  • Failed with python=3.9 and pytorch=1.9
Python 3.9.5 (default, Jun  4 2021, 12:28:51) 
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.9.0'
>>> model = torch.hub.load('pytorch/vision:v0.10.0', 'resnet50', pretrained=True, force_reload=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/site-packages/torch/hub.py", line 362, in load
    repo_or_dir = _get_cache_or_reload(repo_or_dir, force_reload, verbose)
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/site-packages/torch/hub.py", line 162, in _get_cache_or_reload
    _validate_not_a_forked_repo(repo_owner, repo_name, branch)
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/site-packages/torch/hub.py", line 124, in _validate_not_a_forked_repo
    with urlopen(url) as r:
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/home/ml/farleylai/miniconda3/envs/sinet39/lib/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: rate limit exceeded

The Google Drive API returns 2 levels of error information:

  • HTTP error codes and messages in the header.
  • A JSON object in the response body with additional details that can help you
    determine how to handle the error.

Drive apps should catch and handle all errors that might be encountered when
using the REST API. This guide provides instructions on how to resolve specific
API errors.

Resolve a 400 error: Bad request

This error can result from any one of the following issues in your code:

  • A required field or parameter hasn’t been provided.
  • The value supplied or a combination of provided fields is invalid.
  • You tried to add a duplicate parent to a Drive file.
  • You tried to add a parent that would create a cycle in the directory graph.

Following is a sample JSON representation of this error:

{
  "error": {
    "code": 400,
    "errors": [
      {
        "domain": "global",
        "location": "orderBy",
        "locationType": "parameter",
        "message": "Sorting is not supported for queries with fullText terms. Results are always in descending relevance order.",
        "reason": "badRequest"
      }
    ],
    "message": "Sorting is not supported for queries with fullText terms. Results are always in descending relevance order."
  }
}

To fix this error, check the message field and adjust your code accordingly.

Resolve a 400 error: Invalid sharing request

This error can occur for several reasons. To determine the limit that has been
exceeded, evaluate the reason field of the returned JSON. This error most
commonly occurs because:

  • Sharing succeeded, but the notification email was not correctly delivered.
  • The Access Control List (ACL) change is not allowed for this user.

The message field indicates the actual error.

Sharing succeeded, but the notification email was not correctly delivered

Following is the JSON representation of this error:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "invalidSharingRequest",
        "message": "Bad Request. User message: "Sorry, the items were successfully shared but emails could not be sent to email@domain.com.""
      }
    ],
    "code": 400,
    "message": "Bad Request"
  }
}

To fix this error, inform the user (sharer) they were unable to share because
the notification email couldn’t be sent to the email address they want to share
with. The user should ensure they have the correct email address and that it can
receive email.

The ACL change is not allowed for this user

Following is the JSON representation of this error:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "invalidSharingRequest",
        "message": "Bad Request. User message: "ACL change not allowed.""
      }
    ],
    "code": 400,
    "message": "Bad Request"
  }
}

To fix this error, check the sharing settings of the Google Workspace domain to which the file belongs. The settings might
prohibit sharing outside of the domain or sharing a shared drive might not be
permitted.

Resolve a 401 error: Invalid credentials

A 401 error indicates the access token that you’re using is either expired or
invalid. This error can also be caused by missing authorization for the
requested scopes. Following is the JSON representation of this error:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "authError",
        "message": "Invalid Credentials",
        "locationType": "header",
        "location": "Authorization",
      }
    ],
    "code": 401,
    "message": "Invalid Credentials"
  }
}

To fix this error, refresh the access token using the long-lived refresh token.
If this fails, direct the user through the OAuth flow, as described in
API-specific authorization and authentication information.

Resolve a 403 error

An error 403 occurs when a usage limit has been exceeded or the user doesn’t
have the correct privileges. To determine the specific type of error, evaluate
the reason field of the returned JSON. This error occurs for the following
situations:

  • The daily limit was exceeded.
  • The user rate limit was exceeded.
  • The project rate limit was exceeded.
  • The sharing rate limit was exceeded.
  • The user hasn’t granted your app rights to a file.
  • The user doesn’t have sufficient permissions for a file.
  • Your app can’t be used within the signed in user’s domain.
  • Number of items in a folder was exceeded.

For information on Drive API limits, refer to
Usage limits. For information on Drive folder limits,
refer to
Folder limits in Google Drive.

Resolve a 403 error: Daily limit exceeded

A dailyLimitExceeded error indicates the courtesy API limit for your project
has been reached. Following is the JSON representation of this error:

{
  "error": {
    "errors": [
      {
        "domain": "usageLimits",
        "reason": "dailyLimitExceeded",
        "message": "Daily Limit Exceeded"
      }
    ],
    "code": 403,
    "message": "Daily Limit Exceeded"
  }
}

This error appears when the application’s owner has set a quota limit to cap
usage of a particular resource. To fix this error,
remove any usage caps for the «Queries per day» quota.

Resolve a 403 error: User rate limit exceeded

A userRateLimitExceeded error indicates the per-user limit has been reached.
This might be a limit from the Google API Console or a limit from the Drive
backend. Following is the JSON representation of this error:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "userRateLimitExceeded",
    "message": "User Rate Limit Exceeded"
   }
  ],
  "code": 403,
  "message": "User Rate Limit Exceeded"
 }
}

To fix this error, try any of the following:

  • Raise the per-user quota in the Google Cloud project. For more information,
    request a quota increase.
  • If one user is making numerous requests on behalf of many users of a Google Workspace account, consider a
    service account with domain-wide delegation
    using the
    quotaUser parameter.
  • Use exponential backoff to retry the
    request.

For information on Drive API limits, refer to
Usage limits.

Resolve a 403 error: Project rate limit exceeded

A rateLimitExceeded error indicates the project’s rate limit has been reached.
This limit varies depending on the type of requests. Following is the JSON
representation of this error:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "message": "Rate Limit Exceeded",
    "reason": "rateLimitExceeded",
   }
  ],
  "code": 403,
  "message": "Rate Limit Exceeded"
 }
}

To fix this error, try any of the following:

  • Raise the per-user quota in the Google Cloud project. For more information,
    request a quota increase.
  • Batch requests to make fewer
    API calls.
  • Use exponential backoff to retry the
    request.

Resolve a 403 error: Sharing rate limit exceeded

A sharingRateLimitExceeded error occurs when the user has reached a sharing
limit. This error is often linked with an email limit. Following is the JSON
representation of this error:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "message": "Rate limit exceeded. User message: "These item(s) could not be shared because a rate limit was exceeded: filename",
    "reason": "sharingRateLimitExceeded",
   }
  ],
  "code": 403,
  "message": "Rate Limit Exceeded"
 }
}

To fix this error:

  1. Do not send emails when sharing large amounts of files.
  2. If one user is making numerous requests on behalf of many users of a Google Workspace account, consider a
    service account with domain-wide delegation
    using the
    quotaUser parameter.

Resolve a 403 error: Storage quota exceeded

A storageQuotaExceeded error occurs when the user has reached their storage
limit. Following is the JSON representation of this error:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "message": "The user's Drive storage quota has been exceeded.",
    "reason": "storageQuotaExceeded",
   }
  ],
  "code": 403,
  "message": "The user's Drive storage quota has been exceeded."
 }
}

To fix this error:

  1. Review the storage limits for your Drive account. For more information,
    refer to
    Drive storage and upload limits

  2. Free up space

    or get more storage from Google One.

Resolve a 403 error: The user has not granted the app {appId} {verb} access to the file {fileId}

An appNotAuthorizedToFile error occurs when your app is not on the ACL for the
file. This error prevents the user from opening the file with your app.
Following is the JSON representation of this error:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "appNotAuthorizedToFile",
        "message": "The user has not granted the app {appId} {verb} access to the file {fileId}."
      }
    ],
    "code": 403,
    "message": "The user has not granted the app {appId} {verb} access to the file {fileId}."
  }
}

To fix this error, try any of the following:

  • Open the Google Drive picker
    and prompt the user to open the file.
  • Instruct the user to open the file using the
    Open with context menu in the Drive
    UI of your app.

You can also check the isAppAuthorized field on a file to verify that your app
created or opened the file.

Resolve a 403 error: The user does not have sufficient permissions for file {fileId}

A insufficientFilePermissions error occurs when the user doesn’t have write
access to a file, and your app is attempting to modify the file. Following is
the JSON representation of this error:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "insufficientFilePermissions",
        "message": "The user does not have sufficient permissions for file {fileId}."
      }
    ],
    "code": 403,
    "message": "The user does not have sufficient permissions for file {fileId}."
  }
}

To fix this error, instruct the user to contact the file’s owner and request
edit access. You can also check user access levels in the metadata retrieved by
files.get and display a read-only UI when
permissions are missing.

Resolve a 403 error: App with id {appId} cannot be used within the authenticated user’s domain

A domainPolicy error occurs when the policy for the user’s domain doesn’t
allow access to Drive by your app. Following is the JSON representation of this
error:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "domainPolicy",
        "message": "The domain administrators have disabled Drive apps."
      }
    ],
    "code": 403,
    "message": "The domain administrators have disabled Drive apps."
  }
}

To fix this error:

  1. Inform the user the domain doesn’t allow your app to access files in Drive.
  2. Instruct the user to contact the domain Admin to request access for your
    app.

Resolve a 403 error: Number of items in folder was exceeded

A numChildrenInNonRootLimitExceeded error occurs when the limit for a folder’s
number of children (folders, files, and shortcuts) has been exceeded. There’s a
500,000 item limit for folders, files, and shortcuts directly in a folder. Items
nested in subfolders don’t count against this 500,000 item limit. For more
information on Drive folder limits, refer to
Folder limits in Google Drive
.

Resolve a 403 error: Number of items created by account was exceeded

An activeItemCreationLimitExceeded error occurs when the limit for the number
of items, whether trashed or not, created by this account has been exceeded. All
item types, including folders, count towards the limit.

Resolve a 404 error: File not found: {fileId}

The notFound error occurs when the user doesn’t have read access to a file, or
the file doesn’t exist.

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "notFound",
        "message": "File not found {fileId}"
      }
    ],
    "code": 404,
    "message": "File not found: {fileId}"
  }
}

To fix this error:

  1. Inform the user they don’t have read access to the file or the file doesn’t
    exist.
  2. Instruct the user to contact the file’s owner and request permission to the
    file.

Resolve a 429 error: Too many requests

A rateLimitExceeded error occurs when the user has sent too many requests in a
given amount of time.

{
  "error": {
    "errors": [
      {
        "domain": "usageLimits",
        "reason": "rateLimitExceeded",
        "message": "Rate Limit Exceeded"
      }
    ],
    "code": 429,
    "message": "Rate Limit Exceeded"
  }
}

To fix this error, use
exponential backoff to retry the request.

Resolve a 5xx error

A 5xx error occurs when an unexpected error arises while processing the request.
This can be caused by various issues, including a request’s timing overlapping
with another request or a request for an unsupported action, such as attempting
to update permissions for a single page in a Google Site instead of the site
itself.

To fix this error, use
exponential backoff to retry the request.
Following is a list of 5xx errors:

  • 500 Backend error
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout

After the recent Thunderbird update to version 91.2.1, I was asked to sign in again. After signing in, I was told that the app has reached its sign-in rate limit and the developer has to increase it. The full message is as follows:

Authorization Error
Error 403: rate_limit_exceeded

This app has reached its sign-in rate limit for now.

Google limits how quickly an app can get new users. You can try signing in again later or ask the developer (provider-for-google-calendar@googlegroups.com) to increase this app's sign-in rate limit.

If you are the developer for this app, you can request a sign-in rate limit increase.

These are the (censored) displayed request details:
login_hint:
hl: en-GB
response_type: code
redirect_uri: urn:ietf:wg:oauth:2.0:oob:auto
client_id: <maybe an identifying string?>.apps.googleusercontent.com
access_type: offline
scope: https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/tasks

403 userRateLimitExceeded is basically flood protection. Your application can make a max of 10 requests a second for your user. User is defined as IP address unless you send QuotaUser along with your request.

The per-user limit from the Developer Console has been reached.

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "userRateLimitExceeded",
    "message": "User Rate Limit Exceeded"
   }
  ],
  "code": 403,
  "message": "User Rate Limit Exceeded"
 }
}

403 rateLimitExceeded is the same thing just with a different name. Why there are two cant tell you.

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "message": "Rate Limit Exceeded",
    "reason": "rateLimitExceeded",
   }
  ],
  "code": 403,
  "message": "Rate Limit Exceeded"
 }
}

In both cases you should Implement Exponential backoff and try the request again Just slower.

Понравилась статья? Поделить с друзьями:
  • Ошибка 403 play market крым что это
  • Ошибка 403 play market крым как
  • Ошибка 403 play market для крыма
  • Ошибка 403 forbidden что это значит
  • Ошибка 403 forbidden на телефоне что это как исправить