Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate and vision API's seem to ignore ApplicationDefault credentials #2158

Closed
lesv opened this issue Jun 16, 2017 · 12 comments
Closed

translate and vision API's seem to ignore ApplicationDefault credentials #2158

lesv opened this issue Jun 16, 2017 · 12 comments
Assignees
Labels
api: translation Issues related to the Cloud Translation API API. api: videointelligence Issues related to the Video Intelligence API API. api: vision Issues related to the Cloud Vision API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@lesv
Copy link
Contributor

lesv commented Jun 16, 2017

When I was testing gh/gcp/java-docs-samples, by going to the root folder and setting GOOGLE_CLOUD_PROJECT=java-docs-samples-testing and being authenticated as me in the gcloud command line tool. Then doing mvn clean verify the first problem is on translate and it's fixed by setting GOOGLE_APPLICATION_CREDENTIALS.

This is wrong.
@gguuss FYI

@lesv lesv added api: translation Issues related to the Cloud Translation API API. api: videointelligence Issues related to the Video Intelligence API API. api: vision Issues related to the Cloud Vision API. Status: Release Blocking labels Jun 16, 2017
@neozwu neozwu added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jun 16, 2017
@lesv
Copy link
Contributor Author

lesv commented Jun 21, 2017

This may be because we are just including google-cloud-translate & google-cloud-vision, not google-cloud

@gguuss
Copy link
Contributor

gguuss commented Jun 22, 2017

Makes sense, I can check soon to see if updating the dependencies fixes this.

@gguuss
Copy link
Contributor

gguuss commented Jun 23, 2017

For vision and translate, switching to google-cloud did not resolve the ADC issue.

@tcoffee-google
Copy link
Contributor

Some integration tests on this repo appear to depend on using GOOGLE_CLOUD_PROJECT=java-docs-samples-testing --- can you give me permissions on this project?

@lesv
Copy link
Contributor Author

lesv commented Jun 26, 2017

Done

@tcoffee-google
Copy link
Contributor

I've succeeded in reproducing the issue.

I was surprised to find that pointing GOOGLE_APPLICATION_CREDENTIALS to the file /usr/local/google/home/tcoffee/.config/gcloud/application_default_credentials.json created by gcloud auth application-default login does not resolve the problem.

Still investigating ...

@tcoffee-google
Copy link
Contributor

Strangely, I can no longer reproduce the issue in the translate-related tests (as of this morning).

Previously, I observed consistently that the content of the key files was clearly implicated, as explicitly referencing the gcloud-generated file

export GOOGLE_APPLICATION_CREDENTIALS=~/.config/gcloud/application_default_credentials.json

did not resolve the issue, but replacing its content with that of the service account file

cat <...>/java-docs-samples-testing-66e7e8ce4415.json > ~/.config/gcloud/application_default_credentials.json

did resolve the issue.

The general issue persists, but nondeterministically, only in some of the vision-related tests (note that these tests also exhibit other failures). Here I am (sometimes) hitting the 'USER-100s' limit, which I infer to be the backend limit on administrative operations. This seems to have been observed in the wild (in Python):

https://stackoverflow.com/questions/43746016/google-vision-api-tatuscode-resource-exhausted

There is also a report of this occurring in pubsub (in Node.js):

googleapis/google-cloud-node#1756

I suspect we are just hitting backend limits that differ for the accounts associated to the respective credentials.

@lesv Are you still able to reproduce the issue in translate?

@tcoffee-google
Copy link
Contributor

Update: after re-running tests several times, I now see the translate failures again, and am reminded that these were "daily limit exceeded" failures, which now makes sense.

I'm going to close this as WAI. I assume it would not be a persistent problem to run integration tests with a service account, but if so, let's open a separate issue.

@tcoffee-google
Copy link
Contributor

Epilog: @lesv please review GoogleCloudPlatform/java-docs-samples#741 when you get a chance (I'm not able to assign reviewers).

@ericandrewschmidt
Copy link

I can hit this consistently: RESOURCE_EXHAUSTED: Insufficient tokens for quota 'DefaultGroup' and limit 'CLIENT_PROJECT-100s' of service 'language.googleapis.com'

Using: gcloud auth application-default login

What is the correct path to authenticate and not hit this error?

Needless to say this is super frustrating and a few externals are hitting this. Please advise - thanks!

@garrettjonesgoogle
Copy link
Member

@ericandrewschmidt Could you please open a new issue? The present issue is already closed, and your problem might not be related.

@ericandrewschmidt
Copy link

Will do - thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: translation Issues related to the Cloud Translation API API. api: videointelligence Issues related to the Video Intelligence API API. api: vision Issues related to the Cloud Vision API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

6 participants