-
Notifications
You must be signed in to change notification settings - Fork 50
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
JDBC Connectivity Issue with OpenJDK 17 #1687
Comments
@wise-coders The most likely reason for a problem like this is a class conflict in the application. For example if the single-jar-with-dependencies contains a class that is also on the class path of other dependencies of the application, then unpredictable errors can occur. That can again affect the working of the gRPC libraries, including even errors like this. I'll try to take a look at the single-jar-with-dependencies build in this project to ensure it works as-is, but combining it with any other application is risky, as you can easily run into dependency conflicts. |
The single-jar-with-dependencies is prone to dependency issues, due to the fact that the build can only place one version of each file in the jar, if multiple dependencies define the same file. This change adds a test for using the single-jar with a very simple test application. Updates #1687
We are using the single-jar-with-dependencies inside DbSchema, a Google Cloud Spanner database designer. You can download and test it for free. I don't think it's a conflict with other libraries, as the previous releases worked fine, and we continue using the same libraries. |
Thanks for the additional info. That clarifies why you are using the single-jar (although even in a case like this, I would generally recommend not using a single-jar, but dynamically load all dependencies. DBeaver for example does this for the JDBC drivers it supports.)
Yes, but the Spanner JDBC driver does not :-) There is a constant stream of updates to the gRPC libraries that are used by the JDBC driver, and my suspicion is that this error comes from one of those. |
* test: add a test for using the single-jar-with-dependencies The single-jar-with-dependencies is prone to dependency issues, due to the fact that the build can only place one version of each file in the jar, if multiple dependencies define the same file. This change adds a test for using the single-jar with a very simple test application. Updates #1687 * fix: make the test work on the emulator * fix: only add slashes if host is actually set * test: add test for shaded jar
@wise-coders I've added an integration test that verifies that the single-jar-with-dependencies and its shaded cousin work in the simplest possible setup (that is; an application with no other dependencies). Those tests succeed, meaning that there does not appear to be a generic problem with the single-jar. Would it be possible for you to either:
|
@wise-coders Any chance you can provide a minimal reproduction case for this? |
Connecting to Google Cloud Spanner I got the exception below. I use the 2.20.1 single jar with dependencies and OpenJdk17.0.11.
Which could be the reason?
com.google.cloud.spanner.SpannerException: UNAVAILABLE: com.google.cloud.spanner.SpannerException: UNAVAILABLE: com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPreformatted(SpannerExceptionFactory.java:291)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPreformatted(SpannerExceptionFactory.java:297)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:61)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:181)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:110)
at com.google.cloud.spanner.SpannerExceptionFactory.asSpannerException(SpannerExceptionFactory.java:100)
at com.google.cloud.spanner.SessionPool.getDialect(SessionPool.java:3002)
at com.google.cloud.spanner.DatabaseClientImpl.getDialect(DatabaseClientImpl.java:77)
at com.google.cloud.spanner.connection.ConnectionImpl.getDialect(ConnectionImpl.java:450)
at com.google.cloud.spanner.jdbc.AbstractJdbcConnection.getDialect(AbstractJdbcConnection.java:89)
at com.google.cloud.spanner.jdbc.JdbcDatabaseMetaData.getSchemas(JdbcDatabaseMetaData.java:1565)
at com.google.cloud.spanner.jdbc.JdbcDatabaseMetaData.getSchemas(JdbcDatabaseMetaData.java:776)
at com.wisecoders.dbs.dbms.Dbms.listSchemasAndCatalogs(Dbms.java:294)
at com.wisecoders.dbs.dbms.Dbms.loadSchemaMapping(Dbms.java:281)
at com.wisecoders.dbs.dbms.connect.fx.FxTestConnectivityTask.a(FxTestConnectivityTask.java:52)
at com.wisecoders.dbs.dbms.connect.fx.FxTestConnectivityTask.call(FxTestConnectivityTask.java:19)
java.util.concurrent.ExecutionException: com.google.cloud.spanner.SpannerException: UNAVAILABLE: com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:594)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:445)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:118)
at com.google.cloud.spanner.SessionPool.getDialect(SessionPool.java:3000)
at com.google.cloud.spanner.DatabaseClientImpl.getDialect(DatabaseClientImpl.java:77)
at com.google.cloud.spanner.connection.ConnectionImpl.getDialect(ConnectionImpl.java:450)
at com.google.cloud.spanner.jdbc.AbstractJdbcConnection.getDialect(AbstractJdbcConnection.java:89)
at com.google.cloud.spanner.jdbc.JdbcDatabaseMetaData.getSchemas(JdbcDatabaseMetaData.java:1565)
at com.google.cloud.spanner.jdbc.JdbcDatabaseMetaData.getSchemas(JdbcDatabaseMetaData.java:776)
at com.wisecoders.dbs.dbms.Dbms.listSchemasAndCatalogs(Dbms.java:294)
at com.wisecoders.dbs.dbms.Dbms.loadSchemaMapping(Dbms.java:281)
at com.wisecoders.dbs.dbms.connect.fx.FxTestConnectivityTask.a(FxTestConnectivityTask.java:52)
at com.wisecoders.dbs.dbms.connect.fx.FxTestConnectivityTask.call(FxTestConnectivityTask.java:19)
com.google.cloud.spanner.SpannerException: UNAVAILABLE: com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPreformatted(SpannerExceptionFactory.java:291)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPreformatted(SpannerExceptionFactory.java:297)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:170)
at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:110)
at com.google.cloud.spanner.SessionPool$SessionConsumerImpl.onSessionCreateFailure(SessionPool.java:3826)
at com.google.cloud.spanner.SessionClient$BatchCreateSessionsRunnable.run(SessionClient.java:139)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
If you are still having issues, please include as much information as possible:
Environment details
General, Core, and Other are also allowed as types
Steps to reproduce
Code example
// example
Stack trace
External references such as API reference guides
Any additional information below
Following these steps guarantees the quickest resolution possible.
Thanks!
The text was updated successfully, but these errors were encountered: