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

Errors when using Application Default Credentials #140

Closed
subbu14581 opened this issue Nov 12, 2017 · 5 comments
Closed

Errors when using Application Default Credentials #140

subbu14581 opened this issue Nov 12, 2017 · 5 comments
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@subbu14581
Copy link

subbu14581 commented Nov 12, 2017

Exception in thread "main" java.io.IOException: The Application Default Credentials are not available. They are available if running on Google App Engine, Google Compute Engine, or Google Cloud Shell. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
	at com.google.api.client.googleapis.auth.oauth2.DefaultCredentialProvider.getDefaultCredential(DefaultCredentialProvider.java:98)
	at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.getApplicationDefault(GoogleCredential.java:213)
	at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.getApplicationDefault(GoogleCredential.java:191)
	at com.google.cloud.vision.samples.label.LabelApp.getVisionService(LabelApp.java:100)
	at com.google.cloud.vision.samples.label.LabelApp.main(LabelApp.java:73)

BUILD FAILURE

@DIWithers
Copy link

I used C# / Visual Studio for mine but had the same error. Did you download the credentials as per the docs and set your local environment variable (GOOGLE_APPLICATION_CREDENTIALS) with the path to the file?

@JustinBeckwith JustinBeckwith added 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 8, 2018
@JustinBeckwith JustinBeckwith added type: question Request for information or clarification. Not an issue. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Jun 20, 2018
@chingor13
Copy link
Contributor

Yes, to configure ApplicationDefaultCredentials locally or in a non-GCP environment you will want to set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path to your credentials file (downloadable from the Google Cloud Console).

More information is available at the link in the error message: https://cloud.google.com/docs/authentication/production

@99ansh
Copy link

99ansh commented Mar 25, 2020

I have tried all these, still getting the same error. PLEASE HELP!

@ggprod
Copy link

ggprod commented Dec 16, 2020

@Ansh-Mehta I just came across this issue while searching for a way to get Java with SecurityManager to be disabled or to work with the Google Application Default Credentials (for ElasticSearch, related to this: https://www.elastic.co/guide/en/elasticsearch/plugins/7.10/repository-gcs-usage.html#repository-gcs-service-authentication). Perhaps you were running into the same issue (Java SecurityManager interfering with Google Application Default Credentials)?

@99ansh
Copy link

99ansh commented Dec 16, 2020

@Ansh-Mehta I just came across this issue while searching for a way to get Java with SecurityManager to be disabled or to work with the Google Application Default Credentials (for ElasticSearch, related to this: https://www.elastic.co/guide/en/elasticsearch/plugins/7.10/repository-gcs-usage.html#repository-gcs-service-authentication). Perhaps you were running into the same issue (Java SecurityManager interfering with Google Application Default Credentials)?

I don't remember at all 😅, long time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

6 participants