How to restore from 429 Resource has been exhausted (e.g. check quota) - google-people-api

my questions are simple, I am using PEOPLE API and I have skipped the quota limit for one of the users using the API, the error is only shown when trying to create a new contact for this specific user.
The error says code: 429, message: Resource has been exhausted (e.g. check quota).
How can I restore the user to use the API again?
If the limits are reset every minute, how is it possible that after 3 days the user is still blocked?
I do not want to increase the quota, what I want is to restore the quota again.
Additionally to this in my developer panel there is no indication that I have exceeded the quota which for PEOPLE API is limited to 90 per minute.
My code is:
const request = {
requestBody: contact
}
service.people.createContact(request)
.then((res)=>{
console.log('Done to create a contact', res.data);
})
.catch((err)=>{
console.log('Error', err);
})
And the retuning massage is:
response: {
config: {
url: 'https://people.googleapis.com/v1/people:createContact',
method: 'POST',
paramsSerializer: [Function],
data: [Object],
headers: [Object],
params: [Object: null prototype] {},
validateStatus: [Function],
body: '{"names":[{"familyName":"PASIEGA","givenName":"HOTEL","middleName":"VILLA","unstructuredName":"HOTEL VILLA PASIEGA"}],"addresses":[{"type":"home","streetAddress":"LAS BARRERAS, SN","city":"HOZNAYO","region":"S","postalCode":"39716","country":"ESPAÑA","countryCode":"ES"}],"emailAddresses":[{"value":"reservas#grupolospasiegos.com","type":"work"}],"phoneNumbers":[{"value":"785 52 12 58","type":"Villa Pasiega"},{"value":"785 52 12 58","type":"workFax"}],"biographies":[{"value":"Hotel los Pasiegos - Grupoo los Pasiegos","contentType":"TEXT_PLAIN"}],"urls":[{"value":"http://grupolospasiegos.com/contacto/","type":"profile"}],"organizations":[{"type":"Other","name":"HOTEL VILLA PASIEGA","title":"RESERVA"}],"memberships":[{"contactGroupMembership":{"contactGroupResourceName":"contactGroups/199bb8970e07b6a8"}},{"contactGroupMembership":{"contactGroupResourceName":"contactGroups/55fdbf598e048c03"}},{"contactGroupMembership":{"contactGroupResourceName":"contactGroups/5ee644148f02b901"}}]}',
responseType: 'json'
},
data: { error: [Object] },
headers: {
'alt-svc': 'h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"',
'cache-control': 'private',
connection: 'close',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Thu, 22 Oct 2020 12:47:16 GMT',
server: 'ESF',
'transfer-encoding': 'chunked',
vary: 'Origin, X-Origin, Referer',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '0'
},
status: 429,
statusText: 'Too Many Requests'
},config: {
url: 'https://people.googleapis.com/v1/people:createContact',
method: 'POST',
paramsSerializer: [Function],
data: {
names: [Array],
addresses: [Array],
emailAddresses: [Array],
phoneNumbers: [Array],
biographies: [Array],
urls: [Array],
organizations: [Array],
memberships: [Array]
},
headers: {
'Accept-Encoding': 'gzip',
'User-Agent': 'google-api-nodejs-client/0.7.2 (gzip)',
Authorization: 'Bearer ya29.a0AfH6SMAJtuUp3vLhSXlDVyAd80iQc1D-mYZUD7mENq12vTiegBAV834dTGYbpuuVN9wCpJ0JBB51oMwEozhb9_xoM7s9NTiwqBicNYZAjzPpjLL4MvQUp8b-Oqju8opyNwDAJWCnLvUJ5Bvz266z5H1ZXIpe3_YstXDRzw',
'Content-Type': 'application/json',
Accept: 'application/json'
},
params: [Object: null prototype] {},
validateStatus: [Function],
body: '{"names":[{"familyName":"PASIEGA","givenName":"HOTEL","middleName":"VILLA","unstructuredName":"HOTEL VILLA PASIEGA"}],"addresses":[{"type":"home","streetAddress":"LAS BARRERAS, SN","city":"HOZNAYO","region":"S","postalCode":"39716","country":"ESPAÑA","countryCode":"ES"}],"emailAddresses":[{"value":"reservas#grupolospasiegos.com","type":"work"}],"phoneNumbers":[{"value":"942 525 962","type":"Villa Pasiega"},{"value":"942 525 963","type":"workFax"}],"biographies":[{"value":"Hotel los Pasiegos - Grupoo los Pasiegos","contentType":"TEXT_PLAIN"}],"urls":[{"value":"http://grupolospasiegos.com/contacto/","type":"profile"}],"organizations":[{"type":"Other","name":"HOTEL VILLA PASIEGA","title":"RESERVA"}],"memberships":[{"contactGroupMembership":{"contactGroupResourceName":"contactGroups/199bb8970e07b6a8"}},{"contactGroupMembership":{"contactGroupResourceName":"contactGroups/55fdbf598e048c03"}},{"contactGroupMembership":{"contactGroupResourceName":"contactGroups/5ee644148f02b901"}}]}',
responseType: 'json'
},
code: 429,
errors: [
{
message: 'Resource has been exhausted (e.g. check quota).',
domain: 'global',
reason: 'rateLimitExceeded'
}
]
}
The image below you can see my developer google console and it shows that i only have used 25 createContact request in a period of 2 days with a 100% error message which is the message a post here.
image
By the way thanks for your help.

I have found the solution to the problem and I have to be a bit extensive when explaining the solution.
Each google user has a limit on the number of contacts that can be stored in his contacts.google.com account, the limit is 25,000 contacts, if you exceed this limit the error shown in People API is 429 = Too Many Requests, my user only has 9000 contacts so the limit was not the cause of the problem, but what it had not considered is that a few weeks ago Google added a buttom basket for deleted contacts to contacts.google.com and it looks like that each contact deleted is stored and counted as a contact within contacts.google.com. This is what happened to me.
In summary:
My user has 9,000 visible contacts and 16,000 deleted contacts giving a total of 25,000 contacts causing error 429 to be displayed every time I try to create a new contact.
Solution:
Delete all deleted contacts, and everything should be resolved.
Hope:
Google allows access to People API to the contacts in the deleted basket and that error 429 better explains what it refers to cuz as i see in this case it is not a quota problem.
Important:
Thank you very much to #ale13 for your intent to help, I will leave this here in case future developers face the same problem.

Related

AWS SES Email Verification RequestId status

Working on AWS SES Email Verification, after verifying an email i get back a RequestId from the response. Im trying to find a way to get an update form that RequestId i cant find a endpoint or method that can give me an update on this RequestId status.
{
ResponseMetadata: { RequestId: '1234567890' }
}
Here is the docs that im using for the Email Verification https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses-procedure.html
You can't track the status of email verification using the RequestId received from SES email verification response. Pasting a sample response from SES email verification.
{'ResponseMetadata': {'RetryAttempts': 0, 'HTTPStatusCode': 200, 'RequestId': 'abcd-xyz-123', 'HTTPHeaders': {'date': 'Wed, 26 May 2021 04:44:03 GMT', 'x-amzn-requestid': '98768888-1111-qwaq-2222', 'content-length': '248', 'content-type': 'text/xml', 'connection': 'keep-alive'}}}
To get the status of the email verification, you can try list_verified_email_addresses operation. It list out all the verified email addresses. Check whether your required email address is listing in VerifiedEmailAddresses. If it is not there then it is not yet verified.
import boto3
from botocore.config import Config
my_config = Config(region_name = 'us-west-2')
ses = boto3.client('ses', config=my_config)
response = ses.list_verified_email_addresses()
print(response)
Response:
{'ResponseMetadata': {'RetryAttempts': 0, 'HTTPStatusCode': 200, 'RequestId': 'xxxxx', 'HTTPHeaders': {'date': 'Wed, 26 May 2021 05:25:00 GMT', 'x-amzn-requestid': 'xxxxxx', 'content-length': '412', 'content-type': 'text/xml', 'connection': 'keep-alive'}}, u'VerifiedEmailAddresses': ['example#gmail.com']}

Fetch CouchDB to authenticate using cookie

I'm trying to authenticate against couchdb using this documentation
When I do
# first request
const url = 'http://localhost:5984/_session'
fetch(url, {
method: 'POST',
headers: {
"Content-Type": "application/json",
},
body : JSON.stringify({
"name": "my_username",
"password": "my_password"
}),
}).then( data => {
console.log(data)
}).catch(e => {
console.log('Error', e)
})
If one of my_username or my_password IS NOT right i get:
body: (...)
bodyUsed: false
headers: Headers {}
ok: false
redirected: false
status: 401
statusText: "Unauthorized"
type: "cors"
url: "http://localhost:5984/_session"
which is fine.
But, if one of my_username or my_password IS right i get:
body: ReadableStream
bodyUsed: false
headers: Headers {}
ok: true
redirected: false
status: 200
statusText: "OK"
type: "cors"
url: "http://localhost:5984/_session"
instead of
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Length: 43
Content-Type: application/json
Date: Mon, 03 Dec 2012 01:23:14 GMT
Server: CouchDB (Erlang/OTP)
Set-Cookie: AuthSession=cm9vdDo1MEJCRkYwMjq0LO0ylOIwShrgt8y-UkhI-c6BGw; Version=1; Path=/;
HttpOnly
{"ok":true,"name":"root","roles":["_admin"]} // <-- i expect that
And no cookie set.
I also tried curl, it works :
> curl http://localhost:5984/_session
{"ok":true,"userCtx":{"name":null,"roles":[]},"info":{"authentication_handlers":
["cookie","default"]}}
> curl -X POST http://localhost:5984/_session -H "Content-Type: application/json" -d '{"name":"my_username","password":"my_password"}'
{"ok":true,"name":"my_username","roles":["_admin"]}
But I need it to work in a react app, from http:localhost:3000
Maybe it's CORS related? I enabled CORS in CouchDB settings.
How can i modify the first request in order to get the user object for the name/password supplied?
I think Authentication Set-Cookie produce by backend server not by front end. So you need backend like Node.js to get cookie and then get it again from your front end.

Thumbnail upload - Request forbidden by administrative rules

Following this tutorial -> https://developer.vimeo.com/api/upload/thumbnails
I have setup a time of 180s and the request of step 2 has returned status 201.
all the links have a similar format:
https://i.vimeocdn.com/video/<id>_<size>.jpg?r=pad'
Here is the request:
{ protocol: 'https:',
host: 'i.vimeocdn.com',
port: 443,
method: 'PUT',
headers:
{ 'Content-Type': 'image/jpg',
Accept: 'application/vnd.vimeo.*+json;version=3.4',
'User-Agent': 'Vimeo.js/2.1.1',
Authorization: 'Bearer 9a3918a750089766b46f0e8a59a79f49',
'Content-Length': 189 },
body:
'_readableState=&readable=true&_events=&_eventsCount=1&_maxListeners=&path=%2Ffile.jpg&fd=&flags=r&mode=438&start=&end=&autoClose=true&pos=&bytesRead=0&closed=false',
path: '/video/<id>_1920x1080.jpg' }
}
I've tried with that URI but allways get this result:
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>
{ connection: 'close',
'cache-control': 'no-cache',
'content-type': 'text/html',
'accept-ranges': 'bytes, bytes',
via: '1.1 varnish, 1.1 varnish',
'access-control-allow-origin': '*',
date: 'Wed, 10 Jun 2020 16:59:05 GMT',
'x-served-by': 'cache-dfw18638-DFW, cache-ewr18125-EWR',
'x-cache': 'MISS, MISS',
'x-cache-hits': '0, 0',
'x-timer': 'S1591808345.129097,VS0,VE49',
'transfer-encoding': 'chunked' }
The token has the following access:
private create edit upload video_files public
I've tried to do the PUT request to the api hostname, but the page couldn't be found.
Any ideas?
Thanks in advance.
I've used the wrong link, the PUT request must be to a link that looks like this:
https://i.cloud.vimeo.com/video/<id>?expires=<timestamp>&sig=<hash>

Google Datalab is not working now

The easy-and-famous datalab create instance-name command is not longer working. We did not any change in project/apis/keys/ or any other google options.
The same cmd was ok yesterday and now:
user-used-yeserday#pruebaalexborrar:~$ datalab create alexborrarpurbea
ERROR: gcloud crashed (BadStatusCodeError): HttpError accessing
<https://sourcerepo.googleapis.com/v1/projects/pruebaalexborrar/repos
alt=json>:
response: <{'status': '500', 'content-length': '109', 'x-xss-protection':
'1; mod
e=block', 'x-content-type-options': 'nosniff', 'transfer-encoding':
'chunked', 'vary': 'Origin, X-Origin, Referer', 'server': 'ESF', '-content-
encoding': 'gzip', 'cache-control': 'private', 'date': 'Wed, 19 Apr 2017
09:08:43 G
MT', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;
charset=UTF-8'}>, content <{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
>
When I use the same URL on my browser to get the error, I got other different error:
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected
OAuth 2 access token, login cookie or other valid authentication credential.
See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
I guess the 401 error code is not related with the upper 501 from the `datalab create´ command...
I know google now is deploying new cloud release...
Anyone knows what's happening?
There is a reported issue as #37242989 at the issue tracker regarding this, so I suggest that you can add more details and star the issue there to get further updates from the related team working on this.

Google DataFlow python pipeline write failure

I'm running a simple DataFlow pipeline w/ the Python SDK for counting keywords. The job runs fine for pre-processing the input data, but it fails for grouping/output steps with the following error.
I guess the logs says the worker is having an issue accessing the temp folder, but the storage bucket in our project exists with proper permissions. What could be a possible issue for this?
"/usr/local/lib/python2.7/dist-packages/apache_beam/io/gcsio.py", line
606, in write raise self.upload_thread.last_error # pylint:
disable=raising-bad-type HttpError: HttpError accessing
<https://www.googleapis.com/resumable/upload/storage/v1/b/[PROJECT-NAME-REDACTED]-temp-2016-08-07_04-42-52/o?uploadType=resumable&alt=json&name=0015bf8d-fa87-4c9a-82d6-8ffcd742d770>:
response: <{'status': '404', 'alternate-protocol': '443:quic',
'content-length': '165', 'vary': 'Origin, X-Origin', 'server':
'UploadServer', 'x-guploader-uploadid':
'AEnB2UoYRPUwhz-OXlJ437k0J8Uxd1lJvTsFbfVJF_YMP2GQEvmdDpo7e-3DVhuqNd9b1A_RFPbfIcK6hCsFcar-hdI94rqJZUvATcDmGRRIvHecAt5CTrg',
'date': 'Sun, 07 Aug 2016 04:43:23 GMT', 'alt-svc': 'quic=":443";
ma=2592000; v="36,35,34,33,32,31,30"', 'content-type':
'application/json; charset=UTF-8'}>, content <{ "error": { "errors": [
{ "domain": "global", "reason": "notFound", "message": "Not Found" }
], "code": 404, "message": "Not Found" } } >
This is https://issues.apache.org/jira/browse/BEAM-539, which doesn't allow root buckets as outputs for TextFileSink. As a workaround, please use a subdirectory path (e.g. gs://foo/bar) as output locations.