Skip to content
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

"Too Many Requests: 429 Error" when executing guessContactsFromSentEmails #5697

Closed
sosnovsky opened this issue Apr 30, 2024 · 2 comments · Fixed by #5725 or #5788
Closed

"Too Many Requests: 429 Error" when executing guessContactsFromSentEmails #5697

sosnovsky opened this issue Apr 30, 2024 · 2 comments · Fixed by #5725 or #5788
Assignees

Comments

@sosnovsky
Copy link
Collaborator

Sometimes when composing message, after I start entering recipient email appears error popup Error searching contacts and there are such errors in console:

catch.js:45 Too Many Requests: 429 when GET-ing https://www.googleapis.com/gmail/v1/users/me/messages/188b462c4189b5a1 (no body):  -> Resource has been exhausted (e.g. check quota).


provided ajax call stack:
    at Google.gmailCall (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/google.js:40:67)
    at async Gmail.msgGet (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/gmail.js:161:24)
    at async Promise.all (index 46)
    at async Gmail.msgsGet (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/gmail.js:169:24)
    at async Gmail.extractHeadersFromMsgs (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/gmail.js:529:35)
    at async Gmail.fetchMsgsHeadersBasedOnQuery (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/gmail.js:396:24)
    at async Gmail.apiGmailLoopThroughEmailsToCompileContacts (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/gmail.js:497:37)
    at async Gmail.guessContactsFromSentEmails (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/gmail.js:375:17)

url: chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/chrome/elements/compose.htm?frameId=frame_rWjBxgpsDx&acctEmail=[SCRUBBED]&parentTabId=cs.BcSjCrXnsT

    at <async> ajax (/extension/js/common/api/shared/api.ts:98:4)
    at <async> performAjaxRequest (/extension/js/common/api/authentication/google/google-oauth.ts:128:31)
    at <async> gmailCall (/extension/js/common/api/email-provider/gmail/google.ts:19:28)
    at <async> msgGet (/extension/js/common/api/email-provider/gmail/gmail.ts:128:18)
    at <async> msgsGet (/extension/js/common/api/email-provider/gmail/gmail.ts:137:19)
    at <async> extractHeadersFromMsgs (/extension/js/common/api/email-provider/gmail/gmail.ts:454:35)
    at <async> fetchMsgsHeadersBasedOnQuery (/extension/js/common/api/email-provider/gmail/gmail.ts:333:40)
    at <async> apiGmailLoopThroughEmailsToCompileContacts (/extension/js/common/api/email-provider/gmail/gmail.ts:416:55)
    at <async> guessContactsFromSentEmails (/extension/js/common/api/email-provider/gmail/gmail.ts:282:39)

There are also several failed requests trying to fetch messages metadata (https://www.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID?format=metadata
Screenshot 2024-04-30 at 21 18 51

Currently noticed such issue only in #5651, but maybe it exists in master too, can't find exact steps to reproduce it, occurs randomly when composing new message.

@sosnovsky sosnovsky added this to the 8.5.5 milestone Apr 30, 2024
@sosnovsky
Copy link
Collaborator Author

Similar error happened when I opened Encrypted inbox extension page:

catch.js:45 Too Many Requests: 429 when GET-ing https://www.googleapis.com/gmail/v1/users/me/threads/18eb8724b636ddae (no body):  -> Resource has been exhausted (e.g. check quota).


provided ajax call stack:
    at Google.gmailCall (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/google.js:40:67)
    at async Gmail.threadGet (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/api/email-provider/gmail/gmail.js:29:24)
    at async InboxListThreadsModule.renderInboxItem (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/chrome/settings/inbox/inbox-modules/inbox-list-threads-module.js:55:36)
    at async Promise.all (index 42)
    at async InboxListThreadsModule.render (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/chrome/settings/inbox/inbox-modules/inbox-list-threads-module.js:20:25)
    at async InboxView.render (chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/chrome/settings/inbox/inbox.js:50:29)
    at async chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/js/common/view.js:28:25

url: chrome-extension://pjohdcpiapjhagmakkjpgjmodmgfmkkd/chrome/settings/inbox/inbox.htm?acctEmail=[SCRUBBED]&page=

    at <async> ajax (/extension/js/common/api/shared/api.ts:98:4)
    at <async> performAjaxRequest (/extension/js/common/api/authentication/google/google-oauth.ts:128:31)
    at <async> gmailCall (/extension/js/common/api/email-provider/gmail/google.ts:19:28)
    at <async> threadGet (/extension/js/common/api/email-provider/gmail/gmail.ts:35:21)

@sosnovsky sosnovsky modified the milestones: 8.5.5, 8.5.6 May 13, 2024
@ioanmo226 ioanmo226 self-assigned this May 21, 2024
sosnovsky pushed a commit that referenced this issue May 22, 2024
* feat: added promise with limit logic

* fix: promise all limit

* fix: promise limit

* fix: limit

* fix: pr reviews
ioanmo226 added a commit that referenced this issue May 27, 2024
* feat: added promise with limit logic

* fix: promise all limit

* fix: promise limit

* fix: limit

* fix: pr reviews
@sosnovsky
Copy link
Collaborator Author

In the latest release these errors are still happen quite often:

this one when opening encrypted inbox

message: Too Many Requests: 429 when GET-ing https://www.googleapis.com/gmail/v1/users/me/threads/THREAD_ID
url: chrome-extension://EXTENSION_ID/chrome/settings/inbox/inbox.htm 

provided ajax call stack:
at Google.gmailCall (chrome-extension://EXTENSION_ID/js/common/api/email-provider/gmail/google.js:40:67)
at async Gmail.threadGet (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/api/email-provider/gmail/gmail.js:30:24)
at async InboxListThreadsModule.renderInboxItem (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/chrome/settings/inbox/inbox-modules/inbox-list-threads-module.js:55:36)
at async Promise.all (index 25)
at async promiseAllWithLimit (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/core/common.js:479:38)
at async InboxListThreadsModule.render (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/chrome/settings/inbox/inbox-modules/inbox-list-threads-module.js:20:25)
at async InboxView.render (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/chrome/settings/inbox/inbox.js:50:29)
at async chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/view.js:28:25

and this one when entering recipient in compose modal

message: Too Many Requests: 429 when GET-ing https://www.googleapis.com/gmail/v1/users/me/messages/MESSAGE_ID
url: chrome-extension://EXTENSION_ID/chrome/elements/compose.htm 

provided ajax call stack:
at Google.gmailCall (chrome-extension://EXTENSION_ID/js/common/api/email-provider/gmail/google.js:40:67)
at async Gmail.msgGet (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/api/email-provider/gmail/gmail.js:162:24)
at async Promise.all (index 26)
at async promiseAllWithLimit (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/core/common.js:479:38)
at async Gmail.msgsGet (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/api/email-provider/gmail/gmail.js:170:24)
at async Gmail.extractHeadersFromMsgs (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/api/email-provider/gmail/gmail.js:530:35)
at async Gmail.fetchMsgsHeadersBasedOnQuery (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/api/email-provider/gmail/gmail.js:397:24)
at async Gmail.apiGmailLoopThroughEmailsToCompileContacts (chrome-extension://bnjglocicdkmhmoohhfkfkbbkejdhdgc/js/common/api/email-provider/gmail/gmail.js:498:37)

Probably we should catch these 429 errors and add some timeout before the next requests.

@sosnovsky sosnovsky reopened this Jun 22, 2024
@sosnovsky sosnovsky modified the milestones: 8.5.6, 8.5.8 Jun 22, 2024
sosnovsky pushed a commit that referenced this issue Jul 9, 2024
* feat: added timeout before next retry for 429 error

* fix: pr reviews
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment