RESOURCE_EXHAUSTED when calling search method

904 views
Skip to first unread message

msgu...@gmail.com

unread,
Aug 1, 2022, 5:23:57 PM8/1/22
to Google Ads API and AdWords API Forum
Hi team,

From the document, the search quota is 15K requests per user per day. 
But we are seeing random RESOURCE_EXHAUSTED throw from the report search calls.
Could you help us take look if it is caused by a transient issue or if we really run out of quota but didn't be blocked somehow?
timestamp: 2022-07-26 08:32:08.8909869

{"CustomerId":"6764260347","Query":"SELECT\r\n                                recommendation.impact, \r\n                                recommendation.resource_name, \r\n                                customer.id, \r\n                                campaign.resource_name, \r\n                                ad_group.resource_name,\r\n                                recommendation.responsive_search_ad_recommendation \r\n                                FROM recommendation \r\n                                WHERE recommendation.type = 'RESPONSIVE_SEARCH_AD'","PageToken":"","PageSize":10000,"ValidateOnly":false,"ReturnTotalResultsCount":false,"SummaryRowSetting":0}, Errors:["{\"Code\":\"GoogleAdsResourceExhausted\",\"Property\":\"GetRSARecommendation\",\"Message\":\"{\\n  \\\"StatusCode\\\": 8,\\n  \\\"Details\\\": \\\"Resource has been exhausted (e.g. check quota).\\\",\\n  \\\"RequestId\\\": \\\"wDhAgGBloH9MyXDk48IXDg\\\",\\n  \\\"Failure\\\": {\\n    \\\"errors\\\": [\\n      {\\n        \\\"errorCode\\\": {\\n          \\\"quotaError\\\": \\\"RESOURCE_EXHAUSTED\\\"\\n        },\\n        \\\"message\\\": \\\"Too many requests. Retry in 900 seconds.\\\"\\n      }\\n    ],\\n    \\\"requestId\\\": \\\"wDhAgGBloH9MyXDk48IXDg\\\"\\n  }\\n}\"}"], Raw Exception: {
  "StatusCode": 8,
  "Details": "Resource has been exhausted (e.g. check quota).",
  "RequestId": "wDhAgGBloH9MyXDk48IXDg",
  "Failure": {
    "errors": [
      {
        "errorCode": {
          "quotaError": "RESOURCE_EXHAUSTED"
        },
        "message": "Too many requests. Retry in 900 seconds."
      }
    ],
    "requestId": "wDhAgGBloH9MyXDk48IXDg"
  }
}

Google Ads API Forum Advisor

unread,
Aug 1, 2022, 10:59:37 PM8/1/22
to msgu...@gmail.com, adwor...@googlegroups.com
Hi,

This is Carmela from the Google Ads API team. Thank you for raising this concern to our team.

Moving forward, it appears that you have encountered the RESOURCE_EXHAUSTED quota error. The said error means that a system frequency limit has been exceeded. The common cause of this error is when sending too many requests in a short period of time. That said, to avoid this kind of error, I would recommend setting up short delays between requests or combining more operations in fewer requests.

If the error persists even after doing the said suggestion, you can provide the complete request and response logs with with the request ID and request header generated on your end for further investigation. You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Carmela
Google Ads API Team
 


ref:_00D1U1174p._5004Q2d3nwd:ref

msgu...@gmail.com

unread,
Aug 2, 2022, 1:18:28 PM8/2/22
to Google Ads API and AdWords API Forum
Hi,

Thank you for your reply,
Could you explain more details to me?
The common cause of this error is when sending too many requests in a short period of time
How many requests in how short period could trigger this error?

Thanks,
Guofu

Google Ads API Forum Advisor

unread,
Aug 2, 2022, 3:21:02 PM8/2/22
to msgu...@gmail.com, adwor...@googlegroups.com
Hi Guofu,

Thank you for the reply. I work with Carmela and allow me to provide more information here, usually RESOURCE_EXHAUSTED errors occur when you are sending too many requests in a short period of time. The server throws this error once it detects that your request has exceeded the system frequency limit. With this, our team recommends setting up short delays between requests or combining more operations in fewer requests. Please refer to the Best practices guide to optimize the efficiency and performance. Also, you may be experiencing the RESOURCE_EXHAUSTED, if you exceed 15,000 API operations per day for a basic access developer token as discussed in this document same as you mentioned from the previous email.

In addition, the possible reason why you reached the developer token limit is because there are other API requests aside from the keyword plan services. I would suggest checking it on your end. To help you check this using the Google Cloud Console, you can view the list of methods and services to which your project recently submitted requests and its usage:
  1. Open the Dashboard page (found under APIs & Services) in the Google Cloud Console.
  2. Click on Google Ads API in the table.
  3. On the METRICS subtab, you should see your recent requests plotted on each graph. At the bottom of the page, you’ll see the Methods table, where you can see which methods you’ve sent requests to. The method name includes a Google Ads API version, a service, and a method name, e.g., google.ads.googleads.v10.services.GoogleAdsService.Mutate.In this way, you can see all versions that you’ve used recently.
  4. (Optional) Click on the time frame at the top right of the page if you need to change it.

Best regards,
Google Logo
Jinky
Google Ads API Team
 


ref:_00D1U1174p._5004Q2d3nwd:ref

Google Ads API Forum Advisor

unread,
Aug 2, 2022, 3:32:15 PM8/2/22
to msgu...@gmail.com, adwor...@googlegroups.com
Hi Guofu,

In addition to my previous email, you may use back off policy implementation. Note that you may consider waiting 3-5 seconds after each API request in order to avoid too many requests.
Reply all
Reply to author
Forward
0 new messages