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 from within App Engine #45

Closed
ajkannan opened this issue Nov 17, 2015 · 13 comments
Closed
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@ajkannan
Copy link

When using Application Default Credentials from App Engine, both on the local development server (after logging in via gcloud auth login) and in production, I get the following error message:
java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. 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.

Based on that website, it seems like the behavior should be that the SDK credentials are used in the local development server and the App Engine credentials should be provided without setting the GOOGLE_APPLICATION_CREDENTIALS environment variable.

@ajkannan
Copy link
Author

Turns out this was a mistake on my part. In our maven project, we took a dependency on the oauth2_http and credentials modules, but not the appengine module.

@anthmgoogle
Copy link
Contributor

OK. It may be worth creating a new issue along the lines of improving the error message in this case.

@aozarov
Copy link

aozarov commented Nov 18, 2015

@anthmgoogle is there a way to avoid pulling appengine-api-1.0-sdk (17Mb jar) when not necessary.

Few options:

  • Use "provided" or a like as a maven dependency
  • Use reflection to invoke methods on AppIdentityService

gcloud-java used to do the latter.

@Raviraj20
Copy link

Getting an similar error when using an .Net
Can someone help how to solve this error

Message":"An error has occurred.","ExceptionMessage":"The Application Default Credentials are not available. They are available if running in Google Compute Engine. 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.","ExceptionType":"System.InvalidOperationException","StackTrace":" at Google.Api.Gax.TaskExtensions.WaitWithUnwrappedExceptions(Task task)\r\n at Google.Api.Gax.Grpc.ChannelPool.GetChannel(ServiceEndpoint

@ajkannan
Copy link
Author

ajkannan commented May 1, 2017

/cc @garrettjonesgoogle

@ajkannan ajkannan reopened this May 1, 2017
@garrettjonesgoogle
Copy link
Member

@Raviraj20 you code looks like C# - did you want https://github.com/googleapis/gax-dotnet ?

@Raviraj20
Copy link

@garrettjonesgoogle
ya but that to not working showing an similar error
"ExceptionMessage":"The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable

we cant put the credential file in root folder
*.json

@Raviraj20
Copy link

@garrettjonesgoogle
thanks for replying
this https://github.com/googleapis/gax-dotnet this project is not geting open
in vs 2015

geting this error
image

@Raviraj20
Copy link

@garrettjonesgoogle
thanks for replying
this https://github.com/googleapis/gax-dotnet this project is not geting open
its showing a error
this https://github.com/googleapis/gax-dotnet this project is not geting open
image

@garrettjonesgoogle
Copy link
Member

@Raviraj20 , what I meant was that you should file an issue using https://github.com/googleapis/gax-dotnet/issues/new to have the owners of gax-dotnet look at it for you. I can't help you here because this repository is for Java issues.

@Raviraj20
Copy link

@garrettjonesgoogle
ok thanks

@randolfo75
Copy link

I solved the same problem here running: gcloud auth application-default login. I hope helps somebody.

@JustinBeckwith JustinBeckwith added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jun 8, 2018
@chingor13
Copy link
Contributor

The original issue appears to be resolved and it's unclear why it was reopened. Closing this out, but feel free to re-open if this is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

8 participants