Gmail API error 429 - how to resolve the error? - google-api

This is the error I am getting from Gmail, and I am wondering how to resolve this. It appears I have reached a quota.
Mailer: Gmail
{
"error": {
"code": 429,
"message": "User-rate limit exceeded. Retry after 2021-02-15T06:43:03.309Z
(Mail sending)",
"errors": [
{
"message": "User-rate limit exceeded. Retry after 2021-02-15T06:43:03.309Z (Mail sending)",
"domain": "global",
"reason": "rateLimitExceeded"
}
],
"status": "RESOURCE_EXHAUSTED"
}
}

There are two types of quotas, project based quotas which are applied to your full project and user based quotas which are applied to the authenticated user who is making the request.
User rate quotas are flood protection they ensure that a single user does not make to many requests at one time
User-rate limit exceeded. Retry after 2021-02-15T06:43:03.309Z
(Mail sending)",
The error message you are getting now tells you that you have exceeded the send mail quota and you can make a request again after 2021-02-15T06:43:03.309Z .
Solution wait until after 2021-02-15T06:43:03.309Z to make another request, and when you start making requests make sure to slow down so you don't make to many requests and exceed your quota again. A specific technique to retry requests and wait is the exponential backoff where you try a request and wait exponentially increasing periods of time if it fails to give the server time enough for not overpassing the rate limit.
Reference
Resolve 429 error in Gmail API
Retry failed requests
Exponential backoff

Related

429 issues on Solana/metaplex

I thought Solana/Metaplex etc should be able to handle large numbers of transactions in quick succession. I just wrote a load test to do 50 mints of an existing SPL token (that has metaplex token-data associated with it)
In my code I dont specify any particular node/rpc - rather just the cluster i.e. testnet
What should I be doing here ?
{"name":"Error","message":"failed to get info about account 2fvtsp6U6iDVhJvox5kRpUS6jFAStk847zATX3cpsVD8: Error: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\": 429, \"message\":\"Too many requests from your IP, contact your app developer or support#rpcpool.com.\"}, \"id\": \"76627a31-4522-4ebb-ae22-5861fa6781f0\" } \r\n","stack":"Error: failed to get info about account 2fvtsp6U6iDVhJvox5kRpUS6jFAStk847zATX3cpsVD8: Error: 429 Too Many Requests: {\"jsonrpc\":\"2.0\",\"error\":{\"code\": 429, \"message\":\"Too many requests from your IP, contact your app developer or support#rpcpool.com.\"}, \"id\": \"76627a31-4522-4ebb-ae22-5861fa6781f0\" } \r\n\n at Connection.getAccountInfo (/Users/ffff/dev/walsingh/TOKENPASS/tpass-graphql/graphql/node_modules/#metaplex/js/node_modules/#solana/web3.js/lib/index.cjs.js:5508:13)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Token.getAccountInfo (
The 429 issue you are running into is a RPC rate limit. Testnet has the following rate limits at the time of writing:
Maximum number of requests per 10 seconds per IP: 100
Maximum number of requests per 10 seconds per IP for a single RPC: 40
Maximum concurrent connections per IP: 40
Maximum connection rate per 10 seconds per IP: 40
Maximum amount of data per 30 second: 100 MB
You probably ran into one of these limits. The general recommendation is to go get access to one of the RPCs without rate limits, as the public endpoints are not meant for testing how many transactions you can get through.
Quicknode, Triton, and Genesysgo provide RPC infra to use.

Google API limit errors thrown when not even close to limits

I'm using Google Sheet API in 4 different apps.
In 2 of them I'm getting this error far before I actually reach the limit:
GSheet error: rateLimitExceeded: Quota exceeded for quota group 'ReadGroup' and limit 'Read requests per user per 100 seconds' of service 'sheets.googleapis.com' for consumer 'project_number:xxx'.
I also get the same error but for writing.
You can see here, my limits are 500 requests per 100 seconds, and I max out around 15, yet I still get this error a LOT.
Any ideas?

Getting 401 Unauthorized error when threads in JMeter increase

I am running a JMeter script, where I get the Access Token which I use it for my HTTP Request Samplers (By using Bearer ${AccessToken} in Header Manager of each Request). My HTTP Requests are being categorized into multiple Simple Controllers.
There are 70 HTTP GET Requests and ONE Thread takes around 20 seconds to execute them all.
Now when my no. of threads increase, say 3 onwards, then I start getting 401 Errors
({
"statusCode": 401,
"error": "Unauthorized",
"message": "Bad token",
"attributes": {
"error": "Bad token"
}
})
for a few requests. But eventually 401 errors start getting high as no. of Threads increase, keeping Ramp Up time low. for eg: for 5 Requests Ramp Up time = 30 sec.
JMeter Script snapshot
I have checked, my Access Token call always return a different token which is used per new THREAD. so not sure where the issue is :(
So far I have not used any think times, maybe that is one of the issue, but not sure.
By looking at your http get response , The issue is caused most likely due to incorrect value of AccessToken.
Make sure you are passing correct AccessToken to get response.
IF you have a recorded script log, check where this access token originating from and make sure your regular expression extractor is extracting it correctly.
For more information on extracting variables and reusing it in the script you can read this article.

Upload more than 50 Videos using YouTube API

I have a new channel with no videos uploaded yet. When I tried uploading some 500 videos I had using the YouTube Data API, the upload process stopped after about 50 videos. I do not understand how my quota limit reached 300,000 (the per 100 second default limit) as the quota required for uploading 1 video is just 1600. I have to upload around 500-600 videos every day as the nature of my business is such. Please help.
[RequestError] Server response: {
"error": {
"errors": [
{
"domain": "youtube.video",
"reason": "uploadLimitExceeded",
"message": "The user has exceeded the number of videos they may upload."
}
],
"code": 400,
"message": "The user has exceeded the number of videos they may upload."
}
}
This is a user based quota and not a project based quota. It has nothing to do with what you are seeing on the Google Developer console.
The quota used to be:
400 video uploads, 1500 write operations, and 50,000 read operations that each retrieve two resource parts.
Google has apparently changed how the quota works. A user can upload 50 videos then only one video every 15 minutes until the quota resets. Quota resets at midnight west cost USA time.
I have an email out to the team looking for feed back on this.

dailyLimitExceeded errors, but API Console shows 21% of quota

Using the Ruby API client, a service account, and at the "courtesy limit" of 50k requests/day, we start seeing this error after making just a few hundred requests.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "dailyLimitExceeded",
"message": "Quota Error: profileId ga:REDACTED has exceeded the daily request limit."
}
],
"code": 403,
"message": "Quota Error: profileId ga:REDACTED has exceeded the daily request limit."
}
}
The API console shows that we are only at 21% of quota. The other day, the error started happening when we were around 51% of quota.
Our usage has never been very aggressive:
In addition to the account-wide limit of 50,000 requests/day, there is a smaller limit of 10,000 requests per profile/day you're probably hitting:
Core Reporting API and Real Time Reporting API
These quotas are specific to the Core Reporting API and Real Time
Reporting API:
10,000 requests per view (profile) per day
10 concurrent requests per view (profile)

Resources