1

How can I track which Google sheet triggered the below error?

Google API error - [429] Quota exceeded for quota metric 'Read requests' and limit 'Read requests per minute per user' of service 'sheets.googleapis.com' for consumer 'project_number:649201601551'.

TheMaster
  • 45,448
  • 6
  • 62
  • 85

1 Answers1

1

The error 429: Too many requests is related to quotas, since Google Sheets has a per minute quota of 300 to read and write per minute per project or 60 to read and write per minute per user per project. However, Google has a unpublish limit on how many requests you can do for a second. You can read more information about this error message here.

If you exceed a quota, you'll generally receive a 429: Too many requests HTTP status code response. If this happens, you should use an exponential backoff algorithm and try again later. Provided you stay within the per-minute quotas below, there's no limit to the number of requests you can make per day.

Since you use a Google Apps Script tag, I'm inferring that you are using Google Apps Script to read or write requests to a Google Sheet. If you are using some kind of loop, you can use a simple Utilities.sleep(milliseconds) to put the script to sleep for the specified number of milliseconds.

Or you can use "exponential backoff" as mentioned by @TheMaster. I found some articles and posts on how to do it that you can use as a reference.

  1. Google Apps Script Retry With Exponential Backoff
  2. GASRetry - Exponential backoff JavaScript implementation for Google Apps Script
  3. Exponential backoff
Giselle Valladares
  • 2,075
  • 1
  • 4
  • 13
  • Thanks a lot! How do I know the Google sheet triggering this error? – Mohamad El Bohsaly Sep 14 '22 at 17:52
  • 1
    Maybe you can review which Google Sheets are linked to the code with project number: 649201601551. Or maybe review the logs to see if the information or ID of the sheet is tracked there. – Giselle Valladares Sep 14 '22 at 18:13
  • @MohamadElBohsaly, ay have the same concern as you, will know that theirs can be resolved. If the accept button is unavailable to you, feel free to tell me. how to accept answer (https://stackoverflow.com/help/accepted-answer) – Giselle Valladares Sep 15 '22 at 14:58