I am using Gmail API to fetch messages to database.
Yesterday I was testing something and sent too many requests in a small period of time and I might have been blacklisted.
When I want to fetch mails from specific user I get error below. However if I run same script for any other user in domain, there would be no issues.
What bothers me the Retry after DATE
in first line of the error just keeps increasing each time I try again.
Should I wait more or is there anything I can do to fix this?
I am using OAUTH JWT domain wide [delegation] authorization.
{ Error: User-rate limit exceeded. Retry after 2017-02-02T13:15:27.785Z
at Request._callback (/var/www/apps/gmail-api/node_modules/googleapis/node_modules/google-auth-library/lib/transporters.js:85:15)
at Request.self.callback (/var/www/apps/gmail-api/node_modules/googleapis/node_modules/google-auth-library/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/var/www/apps/gmail-api/node_modules/googleapis/node_modules/google-auth-library/node_modules/request/request.js:1044:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/var/www/apps/gmail-api/node_modules/googleapis/node_modules/google-auth-library/node_modules/request/request.js:965:12)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
code: 429,
errors:
[ { domain: 'usageLimits',
reason: 'rateLimitExceeded',
message: 'User-rate limit exceeded. Retry after 2017-02-02T13:15:27.785Z' } ] }
Please note that quotas are far from exceeded.
When testing gmail make sure that you are testing with a throw away gmail account if you spam to much you can get shut down and you don't want to shut down your developer account.
Depending up on which quota you hit sometimes changing users can get you around it. This is because some quotas are user / account based while others are project based. I have three or four accounts I use for testing so you send some requests with each keeps you from getting black listed.
Besides that you normally get blocked until midnight West cost USA time
. I haven't seen that they are reporting a time before must be something new.