Tracking 429 Quota Exceeded

Viewed 45

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'.

1 Answers

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
Related