What is the reason for the error "RESOURCE_EXHAUSTED"?

16k views Asked by At

I have a wordpress blog. When I logged in to the dashboard, the following exception was highlighted at the top:

[Ga_Lib_Api_Request_Exception] There was an error while contacting Google API: {
"error": { "code": 429, "message": "Insufficient tokens for quota group and limit
'AnalyticsDefaultGroupCLIENT_PROJECT-1d' of service 'analyticsreporting.googleapis.com',
using the limit by ID '123******456'.", "status": "RESOURCE_EXHAUSTED",
"details": [ { "@type": "type.googleapis.com/google.rpc.Help",
"links": [ { "description": "Google developer console API key",
"url": "https://console.developers.google.com/project/207216681371/apiui/credential"}]}]}}

From the exception message I could infer that it is something related to Google Analytics and its API.

However, I'm curious to know what could have caused this exception. Also, what steps can I take in order to avoid such exceptions?

3

There are 3 answers

1
Linda Lawton - DaImTo On BEST ANSWER

Manoj gave you the technical information I am going to give you a bit of extra info and answer the following part of your question.

However, I'm curious to know what could have caused this exception. Also, what steps can I take in order to avoid such exceptions?

When we as developers want to access Google APIs we need to register our application with Google. Each API has a different quota that the developers need to keep track of.

a quota is the number of requests you can make to an API.

For example: Considering the Google analytics by default each user of an application can make a maximum of 10 requests a second this is to prevent flooding the servers. You can also make a maximum of 10000 requests to each Google analytics View per day. Most of the quotas are user based however there is one that is project based. RESOURCE_EXHAUSTED is one such quota.

By default the project based quota for google analytics is 50000 requests. If you have a large number of users all making requests you can quickly run out of quota. The quota on my application for example is 500000 my users run though about 70% of that each day. Once you hit this quota there is nothing that can be done the application is locked out until the quota is reset at midnight west cost USA time.

What can be done to avoid it. First off the author of the plugin needs to request an additional quota so that they can service their users better they should also be checking this periodically so that there users never see it. Its probably going to take them a month to get approved for additional quota. As a user you can help by only making requests that you need to make there by not using to much of the daily quota up.

As Manoj stated there is nothing you can do personally to fix this you will need to contact the author of the plugin.

1
Manoj Purohit On

A quick search concluded that the analytics plugin used by your blog may be using more hits and quota that is permissible by google analytics api

enter image description here

You can find error description here and quota limits here. Please get in touch with plugin developer to get this sorted.

0
Thoracius Appotite On

It was caused by a WordPress plugin you are using called "Google Analytics," which is one of many plugins you can use to easily insert analytics tracking code into your page's source. You might disable it and install another plugin that does this without causing errors.

In addition, if this plugin is synchronously pulling from Google's servers on each request, it is needlessly slowing down your page load times. There is no reason why the plugin needs to do this.