You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating google-auth-libraries to 0.3.0, we noticed the following stacktrace when using application default credentials:
com.google.gcloud.RetryHelper$NonRetriableException: java.lang.NullPointerException
at com.google.gcloud.RetryHelper.doRetry(RetryHelper.java:193)
at com.google.gcloud.RetryHelper.runWithRetries(RetryHelper.java:247)
at com.google.gcloud.RetryHelper.runWithRetries(RetryHelper.java:237)
at com.google.gcloud.storage.StorageImpl.listBuckets(StorageImpl.java:291)
at com.google.gcloud.storage.StorageImpl.list(StorageImpl.java:285)
at com.examples.example.Main.main(Main.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:61)
at com.google.gcloud.ServiceOptions$1.initialize(ServiceOptions.java:513)
at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:300)
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.gcloud.spi.DefaultStorageRpc.list(DefaultStorageRpc.java:155)
at com.google.gcloud.storage.StorageImpl$6.call(StorageImpl.java:295)
at com.google.gcloud.storage.StorageImpl$6.call(StorageImpl.java:292)
at com.google.gcloud.RetryHelper.doRetry(RetryHelper.java:181)
After updating google-auth-libraries to 0.3.0, we noticed the following stacktrace when using application default credentials:
I think the issue was introduced in this commit. Also see https://github.com/google/google-auth-library-java/blame/master/oauth2_http/java/com/google/auth/http/HttpCredentialsAdapter.java#L61
The HTTP client's request factory seems to initialize the request before it sets the URL.