question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use with Application Default Credentials

See original GitHub issue

Environment details

  • OS: Windows
  • Node.js version: 13.6.0
  • npm version: 6.13.4
  • @google-cloud/vision version: 1.9.0

Steps to reproduce

  1. Have my gcloud shell all set up correctly for ADC
  2. Try and use this library as I’m using all my other Google API Node.js Client libraries
  3. Get an error:

7 PERMISSION_DENIED: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the vision.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/.

Has this always been the case? I thought I’d made use of the library before with ADC.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
lostpebblecommented, Mar 5, 2020

@AlanGasperini ahh okay. Thanks for explaining.

I now ran the auth like so:

gcloud auth application-default login --add-quota-project

and my application_default_credentials.json looks like this:

{
  "client_id": xxx,
  "client_secret": xxx,
  "quota_project_id": xxx,
  "refresh_token": xxx,
  "type": "authorized_user"
}

Unfortunately the same error is persisting though.

7 PERMISSION_DENIED: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the vision.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/.

I think something must have broken for @google-cloud/vision, or it isn’t communicating properly with the billing stuff. I make use of multiple APIs which require billing and they still continue to run without issue.

2reactions
wvviniciuscommented, May 7, 2020

Hello devs, has anyone managed to solve these problems? The same thing happens to me. 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Application Default Credentials works | Authentication
This command places a JSON file containing your credentials in a well-known location on your file system. The location depends on your operating...
Read more >
Application Default Credentials not working locally with App ...
Does anyone know how to get the Application Default Credentials to work locally with an App Engine app? I'm trying to use the...
Read more >
User Guide — google-auth 1.30.0 documentation
Use application default credentials. default() will automatically detect if these credentials are available. Use compute_engine.Credentials :.
Read more >
Resolving 'Application Default Credentials' error ... - NEX Softsys
When working with Google ASP.NET MVC 4 applications or C # libraries, to leverage the Google Cloud Platform computer infrastructure as a platform,...
Read more >
Google Cloud Application Default Credentials - PHP
The Google Cloud PHP SDK will search specific locations and use the first valid method to create credentials. There are two types of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found