Google Sites 403 Forbidden: Insufficient storage quota - google-api

I'm developing an application in which I've wrote a function (.NET) to create a Google Site.
It works perfectly fine, up until I'm testing for a while and have created and deleted several sites in a relatively short time span: I eventually end up with the 403 Forbidden: Insufficient storage quota response. It's usually fixed after a day or 2, but it's not the first time I've encountered this issue, so I thought I should share it and see if anyone else has encountered the same thing.
I've read the article about Google Sites storage quota at https://support.google.com/sites/answer/96770?hl=en, but it doesn't seem like I've hit any of the quota. The sites that are created are empty templates, so the site quota can't be reached. They're located under a https://sites.google.com/a/ domain.
To make sure it isn't a configuration issue, I've tested the raw requests in the OAuth 2.0 Playground which can be found on https://developers.google.com/oauthplayground/, resulting in the same error response.
Steps to reproduce:
I've created multiple sites under the same Google Sites domain
I'm eventually unable to make more sites due to the "403 Forbidden - Insufficient storage quota" error
Even after deleting multiple sites, the issue still persists
Because the code I've written is quite long and not really relevant, I've made a GitHub snippet for the ones who are interested:
https://gist.github.com/Cyanized/8ef24ff1de6454fd4ccd6466d591a53d
Is there something I'm overlooking, or is it a known issue/bug?
Many thanks in advance!

I contacted Google Apps Support, and they've linked me an article with the answer.
The maximum amount of sites you can create on an account in a week is 5. If you go over that amount, you will get the error I mentioned. When the week is over, you're able to create more sites again.
This is a global restriction and can't be changed at the current time.
Reference:
https://support.google.com/sites/answer/117477?hl=en

Related

Google Places API OVER_QUERY_LIMIT

I'm working on a script which sends a few hundreds of API calls to Google Places API using the [nearbySearch]. After a few requests, I quickly get an OVER_QUOTA_LIMIT error.
In Google Cloud Console, I can see the requests made in the last days or hours but:
I'm a far cry from the 6 000 requests/minutes limit
I don't see any Quota Exceed Error in the graph
(https://developers.google.com/maps/documentation/javascript/places#place_search_requests)
If I scroll down a bit, I can see that there's apparently a "Premium Plan", but no request have been made up to now.
Now I can see that the Premium Plan is not available anymore for sign up or new customers..
So I guess it's just a graph to support people who have previously signed for this plan but that it is not relevant in my case.
My payment settings have been set up correctly so I don't understand what's happening here.
Thank you so much.

googleapi: Error 500: Internal error encountered., backendError when calling Admin SDK

This is strange we have started receiving too many per day (nearly 300-500 times)
googleapi: Error 500: Internal error encountered., backendError
while calling Admin SDK Directory API. https://developers.google.com/admin-sdk/directory
Google chat support for API is removed and Facing issue with how to address the problem. Our rate limit and query calls are way in the limits. We query Admin SDK as a cronjob schedule.
Is there a way we can debug 500 errors for AdminSDK
Is there any information regarding which deployment Region of Google is more capable to handle load?
No error on console
Logs error
Contact Workspace Support or File a Bug
As DalmTo pointed out, 500 errors are usually out of your control. Especially in this case since you are calling Google's servers.
The best option to debug these errors is probably contacting support directly. You can find the corresponding contact information for your Workspace account ⁠on this page.
https://support.google.com/a/answer/1047213?hl=en
If you are able to regularly reproduce this and you think its a bug, fill out the template here:
https://issuetracker.google.com/issues/new?component=191635&template=824102
Ensure to include your code, complete reproduction steps, some evidence/statistics of the failures, and any other information you can give.
This usually happens when the Google Cloud Platform service account used for authentication was created after the in-app products.
To solve this, make a trivial edit to your in-app products in the Google Play Console. For example, add a temporary tag. Then try again to make the request and it should succeed.
By the way, the same is true for the purchases.voidedpurchases which reports an "insufficient permissions" error.

Google directory api always returns 403

I am trying to use the Admin SDK Directory api to look up user profiles. I am able to do this successfully all day (with in quota) with 99% of the time. Though there are certain times where it just fails no matter what.
Yes I have set the service account user, I have the proper scopes, I have admin api turned on.
It even fails in the google api explorer. See screen shots
The call:
https://www.dropbox.com/s/9v9m6s5zf76oix7/call.png?dl=0
The response:
https://www.dropbox.com/s/te6k3x5xjkr467j/response.png?dl=0
Sorry for the links, images keep showing as broken
After contacting google they supplied an answer. There is a setting for the contacts app that enables and disables this.
Admin console >> Google Apps >> Settings for Contacts >> Advanced settings
Contact sharing: Enable contact sharing
Make sure that is enabled and it works.
Here is a screen shot: https://www.dropbox.com/s/8jmzz7zw0xq4ux4/answer.png?dl=0
Honestly, it just seems like some sort of transient error on the Google side. Being that it's working ~99% of the time for you, means you're not doing anything wrong. I would consider this more true b/c you're also using a Google Tool rather than your own so you know it's not the code. When it's failing for you, does it also then fail with the API explorer? What about with the OAuth Playground?
If this is reproducible consistently (same times, after X amount of requests, etc.), it would be worth reporting the the Google for Work Support team (assuming you have the ability to contact support) as it sounds like a bug and they would be able to help with break/fix for API issues.

An error occurred {"type":"PLATFORM_ERROR", "payload":"0"}, while updating merchant information in google play

I am trying to update Merchant Information in my Google play account. I have two queries on this,
Before I could do anything on this page, there is an error window as,
An error occurred {"type":"PLATFORM_ERROR", "payload":"0"}.
How to resolve this?
Google play requires business website under the 'Merchant Information' section. What should
I put there?
Cheers!
Fixed this with the help of Google play support team. Needed to clear the browser cache and cookies. Besides, keeping the system time consistent with the current time(which was wrong initially).

Garb request to Google Analytics fails from home ISP, but works elsewhere

I'm trying to use the garb gem to access data from the Google analytics API and find that http requests using garb work just fine from a Linode account, but are refused from home (Comcast). Is Google rejecting some kinds of http requests from certain ISPs, or am I just doing something wrong? Simple example is below:
require 'garb'
Garb::Session.login('XXXXXX#gmail.com', 'XXXXXX')
#profile = Garb::Profile.all.first
#report = Garb::Report.new(#profile)
#report.metrics :visits
puts #report.results
This give => [#<OpenStruct visits="21">] on my Linode, but the exact same thing run from my home ISP gives:
Garb::DataRequest::ClientError: "<errorsxmlns=.........
Which is raised here in garb:
def send_request
response = if #session.single_user?
single_user_request
elsif #session.oauth_user?
oauth_user_request
end
raise ClientError, response.body.inspect unless response.kind_of?(Net::HTTPSuccess)
response
end
The initial session login works just fine from both IPs. The error is only thrown when results are requested. Is there anything I can do to fix this? I haven't (yet) verified that I get exactly the same behavior going through clientlogin/data requests by hand. I'm pretty convinced it is not a gem issue, but an IP-related one--perhaps something to do with Google web services quota policies--but I'm willing to entertain all possible solutions.
Thanks,
Orion
You've probably made too many calls to google in a short space of time. I haven't seen it happen with Garb, but I've seen it happen when using an API to scrape search results pages. Google notices and flags your IP. Try browsing to google.com and running a normal google search from the ip that's blocked, you'll probably be required to enter a captcha. They probably block API calls from that IP at this stage, you'll get cleared eventually after a few days I think.
Jeremy's probably right.
Google Analytics API has multiple quotas you need to worry about. See here their list here. I've hit the 10 queries per second per IP address quota and/or the 10 concurrent requests per profile before. I also saw 4 concurrent requests per IP address somewhere.
You should post the full error message Garb gives you next time, since those have actually helped me figure out what caused it in the past.
Also, these quotas are for projects sending registered API keys along with their requests. If you're not, the quotas are much lower. I hit the quota for an unregistered project before. Registering your project is fairly easy, and you just add the following line
Garb::Session.api_key = 'API_KEY'
to your code (I'm using Sija's fork) before the Garb::Session.login line.
Another thing, once you register your project, go to Quotas page on the API console and click the "Set per-user limits" and up that from the default 1.0 to the max 10.0 requests/second/user. If you click "Request more" they give some tips for optimizing your calls/timing as to not hit the limit.

Resources