V3.3.2 JDBC connection error

Hi,

I am running V3.3.2 DremIO docker image, ie dremio-oss build 3.3.2-201908141640190085-d60145d. When I use either the V3.3.2 JDBC driver that came with the docker image, ie dremio-jdbc-driver-3.3.2-201908141640190085-d60145d.jar or downloaded from https://www.dremio.com/drivers/, ie dremio-jdbc-driver-3.3.2-201908142136370993-d60145d.jar, I encountered the following error message / stack trace when calling DriverManager.getConnection(DB_URL, USER, PASS):

java.sql.SQLException: Failure in connecting to Dremio: cdjd.com.dremio.exec.rpc.RpcException: HANDSHAKE_COMMUNICATION : [USER]: Channel closed null <–> null (user client)
at com.dremio.jdbc.impl.DremioConnectionImpl.(DremioConnectionImpl.java:110)
at com.dremio.jdbc.impl.DremioJdbc41Factory.newConnection(DremioJdbc41Factory.java:72)
at com.dremio.jdbc.impl.DremioFactory.newConnection(DremioFactory.java:67)
at cdjd.org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
at com.dremio.jdbc.Driver.connect(Driver.java:70)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at rest.DremIoJDBCTest.main(DremIoJDBCTest.java:24)
Caused by: cdjd.com.dremio.exec.rpc.RpcException: HANDSHAKE_COMMUNICATION : [USER]: Channel closed null <–> null (user client)
at cdjd.com.dremio.exec.client.DremioClient$FutureHandler.connectionFailed(DremioClient.java:826)
at cdjd.com.dremio.sabot.rpc.user.QueryResultHandler$ChannelClosedHandler.connectionFailed(QueryResultHandler.java:386)
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$HandshakeSendListener.failed(BasicClient.java:401)
at cdjd.com.dremio.exec.rpc.RequestIdMap$RpcListener.setException(RequestIdMap.java:140)
at cdjd.com.dremio.exec.rpc.RequestIdMap$SetExceptionProcedure.apply(RequestIdMap.java:76)
at cdjd.com.dremio.exec.rpc.RequestIdMap$SetExceptionProcedure.apply(RequestIdMap.java:66)
at cdjd.com.carrotsearch.hppc.IntObjectHashMap.forEach(IntObjectHashMap.java:692)
at cdjd.com.dremio.exec.rpc.RequestIdMap.channelClosed(RequestIdMap.java:62)
at cdjd.com.dremio.exec.rpc.RemoteConnection.channelClosed(RemoteConnection.java:200)
at cdjd.com.dremio.exec.rpc.RpcBus$ChannelClosedHandler.operationComplete(RpcBus.java:203)
at cdjd.com.dremio.exec.rpc.RpcBus$ChannelClosedHandler.operationComplete(RpcBus.java:189)
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at cdjd.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103)
at cdjd.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
at cdjd.io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1148)
at cdjd.io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:764)
at cdjd.io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:740)
at cdjd.io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:611)
at cdjd.io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1356)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
at cdjd.io.netty.channel.ChannelOutboundHandlerAdapter.close(ChannelOutboundHandlerAdapter.java:71)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
at cdjd.io.netty.channel.ChannelDuplexHandler.close(ChannelDuplexHandler.java:73)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:608)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:465)
at cdjd.com.dremio.exec.rpc.RpcExceptionHandler.exceptionCaught(RpcExceptionHandler.java:37)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at cdjd.io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at cdjd.io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at cdjd.io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at cdjd.io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at cdjd.io.netty.channel.ChannelHandlerAdapter.exceptionCaught(ChannelHandlerAdapter.java:87)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at cdjd.io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:256)
at cdjd.io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1381)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:285)
at cdjd.io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:264)
at cdjd.io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:933)
at cdjd.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:112)
at cdjd.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:157)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:545)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)
at cdjd.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at cdjd.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: cdjd.com.dremio.exec.rpc.ChannelClosedException: [USER]: Channel closed null <–> null (user client)
at cdjd.com.dremio.exec.rpc.RpcBus$ChannelClosedHandler.operationComplete(RpcBus.java:201)
… 60 more

However, when I switch to V3.0.6 JDBC driver, ie dremio-jdbc-driver-3.0.6-201812082352540436-1f684f9.jar, I am able to successfully connect to DremIO and execute queries. Is there any additional configuration required to run V3.3.2 JDBC driver?

Regards,

Eric

Any luck with resolving this ? I am getting the same error

@eshieh and @raju

Kindly provide us with the Dremio job profile

How to Share Dremio Query Profile

Is there a Dremio job or query profile when the error occured while connecting? I wasn’t able to connect to Dremio via JDBC when I called DriverManager.getConnection(DB_URL, USER, PASS) (see stacktrace in my original post).

@eshieh, are trying to initiate a Dremio JDBC connection to Dremio, or another DB? Can you share the snippet of code you are using to build the connection (scrubbed of passwords and usernames, of course)?

It’s in my original post (which also included the stack trace), pretty much standard JDBC:

Class.forName(“com.dremio.jdbc.Driver”);
Connection conn = DriverManager.getConnection(“jdbc:dremio:direct=192.168.86.40:31011”, “username”,“password”);

When I switched to V3.0.6 JDBC driver, ie dremio-jdbc-driver-3.0.6-201812082352540436-1f684f9.jar, it works fine, the problem seems to be with V3.3.2 driver (see detailed driver jar file names at the beginning of this topic thread).

1 Like

I am getting this error when I try to connect one of the data query tool using Dremio JDBC . So there is no Dremio job ? Is that what you are asking ?

@raju, what version of the Dremio JDBC driver are you using and which data query tool?

@raju, what version of JDK are you using for the client? Recent Dremio JDBC drivers require JDK 8

I am also getting this error. Profile attached.

channel_closed.zip (33.0 KB)

another one:

bad_more.zip (34.8 KB)

Using spark jdbc connection.

@kprifogle, what Java runtime are you using with the JDBC client? As I informed @raju, you will need Java 8

Thank you for this post. I was getting the same issue in both Docker and PCF deployments of the 4.1.3 jdbc dremio driver. Once I switched to the 3.0.6 driver it worked perfectly.

Thanks I was having same error used jdbc driver you mentioned It is working now.

@ben Hi. I’ve just start using Dremio docker image and while UI works correctly I’m running into same issues as in original post when connecting via latest JDBC driver (dremio-jdbc-driver-11.0.0-202011171636110752-16ab953d.jar). The 2 years old driver version 3.0.6 works correctly. I’m using JDK 11.

Any idea what could be wrong? Do you need me to provide additional details?

Hi @david-kubecka,

If you are using Java 11 to run the (newer) driver, try adding this parameter to the runtime:

-Dcdjd.io.netty.tryReflectionSetAccessible=true

Does this resolve the issue?

Thanks @ben. This indeed works!

FYI, I’ve had the same problem with 4.X and 3.3.x drivers. The flag
-Dcdjd.io.netty.tryReflectionSetAccessible=true
did not work for me.
I fell back to 3.0.6 and that solved the problem for me.

I saw a similar behavior with version 11 of the dremio-jdbc-driver-11.0.0-202011171636110752-16ab953d.jar running Java 8 and attempting to connect Tableau 2020.3 over JDBC. I found the same answer at the bottom of the Tableau connection docs. It’d be great to see those sorts of fixes in release notes to accompany the driver download page. It’d also help to know the tested Java versions / Dremio configurations used to test each JDBC driver that dremio releases.

I have been testing JDBC with Dremio and I am having some connection issues.
Java Installed (JDK and JRE)

DBeaver - Timed out after 30s waiting to connect to dremio
RazorSQL - HANDSHAKE_COMMUNICATION —>> CHANEL CLOSED
Tableau - Works Only When Using URL when adding a Source (Direct Download Tableau Button inside Dremio Gives Connection Error)
PowerBi - Same as Tableau Works only from BI but when download PowerBi file from Dremio it also Fails

Using the Newest JDBC Driver. Successful curl -v telnet shows connected