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

DefaultCredentialProvider should detect GAE Standard #1231

Open
janhicken opened this issue Jan 8, 2019 · 0 comments
Open

DefaultCredentialProvider should detect GAE Standard #1231

janhicken opened this issue Jan 8, 2019 · 0 comments
Labels
priority: p4 type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@janhicken
Copy link

janhicken commented Jan 8, 2019

This is the same issue as #1083, which has been fixed with #1109. However, the PR's changes but got reverted shortly after with #1123.

Now, I'm running into issues using the Cloud Endpoints framework on App Engine Standard with Java 8. I've registered a ControlFilter to publish API metrics to the Service Management API. This process uses the DefaultCredentialProvider to obtain credentials to authenticate against the Service Management API.
The flushing of these metrics will get executed in a different thread, so the error shown below (see stacktrace) is thrown. I would expect that no App Identity credential will be used in GAE Standard Java 8, instead the Metadata Server should be queried for a token (Compute Engine credential).

Environment details

  • OS: App Engine Standard
  • Java version: 8
  • google-api-java-client version: 1.25.0

Steps to reproduce

  1. Add endpoints-management-control library
  2. Add a configured ControlFilter to the EndpointsServlet
  3. Wait for the App Identity credential to be requested from memcache

Stacktrace

com.google.api.control.Client scheduleFlushes: scheduler com.google.api.control.Client@7d1da3d0 failed and exited (Client.java:304)
com.google.apphosting.api.ApiProxy$CallNotFoundException: Can't make API call memcache.Get in a thread that is neither the original request thread nor a thread created by ThreadManager at 
com.google.apphosting.api.ApiProxy$CallNotFoundException.foreignThread(ApiProxy.java:844) at 
com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:183) at 
com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:180) at 
com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:93) at 
com.google.appengine.api.memcache.MemcacheServiceImpl.quietGet(MemcacheServiceImpl.java:28) at 
com.google.appengine.api.memcache.MemcacheServiceImpl.get(MemcacheServiceImpl.java:51) at 
com.google.appengine.api.appidentity.AppIdentityServiceImpl.getAccessToken(AppIdentityServiceImpl.java:302) at 
com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential.intercept(AppIdentityCredential.java:100) at 
com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredential$AppEngineCredentialWrapper.intercept(AppIdentityCredential.java:245) at 
com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859) at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) at 
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) at 
com.google.api.control.Client.flushAndScheduleReports(Client.java:397) at 
com.google.api.control.Client.access$200(Client.java:61) at 
com.google.api.control.Client$4.run(Client.java:416) at 
com.google.api.control.Client$Scheduler.run(Client.java:765) at 
com.google.api.control.Client$Scheduler.run(Client.java:775) at 
com.google.api.control.Client.scheduleFlushes(Client.java:297) at 
com.google.api.control.Client.access$000(Client.java:61) at 
com.google.api.control.Client$2.run(Client.java:137) at 
java.lang.Thread.run(Thread.java:745)

@JustinBeckwith JustinBeckwith added 🚨 This issue needs some love. triage me I really want to be triaged. labels Jan 22, 2019
@sduskis sduskis added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p4 type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants