olavloite / spanner-jdbc

JDBC Driver for Google Cloud Spanner
MIT License
38 stars 10 forks source link

1.1.1 release breaks GCP authentication with GOOGLE_APPLICATION_CREDENTIALS #116

Closed O1O1O1O closed 5 years ago

O1O1O1O commented 5 years ago

I updated to 1.1.1 to test the fix for #110 but when trying to connect to Spanner I get this exception:

11:01:01.900 accassistsvc HikariPool ERROR - HikariPool-2 - Exception during pool initialization.
nl.topicus.jdbc.shaded.com.google.cloud.spanner.SpannerException: UNAUTHENTICATED: nl.topicus.jdbc.shaded.io.grpc.StatusRuntimeException: UNAUTHENTICATED: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
    at nl.topicus.jdbc.shaded.com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPreformatted(SpannerExceptionFactory.java:119)
    at nl.topicus.jdbc.shaded.com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:71)
    at nl.topicus.jdbc.shaded.com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:58)
    at nl.topicus.jdbc.shaded.com.google.cloud.spanner.SessionPool$Waiter.take(SessionPool.java:490)
    at nl.topicus.jdbc.shaded.com.google.cloud.spanner.SessionPool$Waiter.access$3300(SessionPool.java:476)
    at nl.topicus.jdbc.shaded.com.google.cloud.spanner.SessionPool.getReadSession(SessionPool.java:840)
    at nl.topicus.jdbc.shaded.com.google.cloud.spanner.DatabaseClientImpl.singleUse(DatabaseClientImpl.java:73)
    at nl.topicus.jdbc.statement.AbstractCloudSpannerStatement.getReadContext(AbstractCloudSpannerStatement.java:193)
    at nl.topicus.jdbc.statement.CloudSpannerStatement.executeQuery(CloudSpannerStatement.java:177)
    at nl.topicus.jdbc.CloudSpannerConnection.isValid(CloudSpannerConnection.java:624)

I'm authenticating via credentials pointed to by GOOGLE_APPLICATION_CREDENTIALS. If I revert to 1.1 everything is fine again.

olavloite commented 5 years ago

Fixed for version 1.1.2 and released version 1.1.2.