Connection to Dremio getting lost in internal project environmments

Hello Team,

The connection to Dremio is getting lost at a random date/time to our project specific environments,
Dremio version:4.1.3
Dremio JDBC version:4.1.3
JDK version:1.8

We found a similar article related to the issue,

Reporting System Logs:
Reporting System Logs:
ERROR!~ [ _Auto_Report_Scheduler_Worker-14] 2022/11/17 02:58:00 AM EST!~ Dremio

Query Exection Error: java.sql.SQLException: IllegalArgumentException: Attempted to send a message when connection is no longer valid. null <
--> null (user client):/java.sql.SQLException: IllegalArgumentException: Attempted to send a message when connection is no longer valid. null <--> null (user client)
at com.dremio.jdbc.impl.DremioCursor.nextRowInternally(DremioCursor.java:507)
at com.dremio.jdbc.impl.DremioCursor.loadInitialSchema(DremioCursor.java:593)
at com.dremio.jdbc.impl.DremioResultSetImpl.execute(DremioResultSetImpl.java:1909)
at com.dremio.jdbc.impl.DremioResultSetImpl.execute(DremioResultSetImpl.java:73)
at cdjd.org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
at com.dremio.jdbc.impl.DremioMetaImpl.prepareAndExecute(DremioMetaImpl.java:184)
at cdjd.org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
at com.dremio.jdbc.impl.DremioConnectionImpl.prepareAndExecuteInternal(DremioConnectionImpl.java:123)
at cdjd.org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
at cdjd.org.apache.calcite.avatica.AvaticaStatement.executeLargeUpdate(AvaticaStatement.java:236)
at com.dremio.jdbc.impl.DremioStatementImpl.executeLargeUpdate(DremioStatementImpl.java:119)
at cdjd.org.apache.calcite.avatica.AvaticaStatement.executeUpdate(AvaticaStatement.java:231)
at com. .autoreport.dao.impl.AutoReportGeneratorDAOImpl.dremioAutoReportQueryExecution(AutoReportGeneratorDAOImpl.java:394)
at com. .autoreport.dao.impl.AutoReportGeneratorDAOImpl.getDremioReportData(AutoReportGeneratorDAOImpl.java:364)
at com. .autoreport.helper.AutoReportGeneratorHelper.generateAndSendReport(AutoReportGeneratorHelper.java:751)
at com. .autoreport.helper.AutoReportGeneratorHelper$$FastClassBySpringCGLIB$$f18a3e2.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at com.autoreport.helper.AutoReportGeneratorHelper$$EnhancerBySpringCGLIB$$27418c26.generateAndSendReport(<generated>)
at com.autoreport.generator.AutoReportGeneratorJob.execute(AutoReportGeneratorJob.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: cdjd.com.dremio.common.exceptions.UserException: IllegalArgumentException: Attempted to send a message when connection is no longer valid. null <--> null (user client)
at cdjd.com.dremio.common.exceptions.UserException$Builder.build(UserException.java:776)
at cdjd.com.dremio.sabot.rpc.user.QueryResultHandler$SubmissionListener.failed(QueryResultHandler.java:293)
at cdjd.com.dremio.exec.rpc.RpcBus.send(RpcBus.java:173)
at cdjd.com.dremio.exec.rpc.RpcBus.send(RpcBus.java:123)
at cdjd.com.dremio.exec.rpc.BasicClient.send(BasicClient.java:170)
at cdjd.com.dremio.sabot.rpc.user.UserClient.submitQuery(UserClient.java:102)
at cdjd.com.dremio.exec.client.DremioClient.runQuery(DremioClient.java:741)
at com.dremio.jdbc.impl.DremioCursor.loadInitialSchema(DremioCursor.java:571)
... 24 more
Caused by: cdjd.com.dremio.exec.rpc.RpcException: Failure sending message.
... 30 more
Caused by: java.lang.IllegalArgumentException: Attempted to send a message when connection is no longer valid. null <--> null (user client)
at cdjd.com.google.common.base.Preconditions.checkArgument(Preconditions.java:191)
at cdjd.com.dremio.exec.rpc.RequestIdMap.createNewRpcListener(RequestIdMap.java:90)
at cdjd.com.dremio.exec.rpc.RemoteConnection.createNewRpcListener(RemoteConnection.java:172)
at cdjd.com.dremio.exec.rpc.RpcBus.send(RpcBus.java:161)
... 29 more

So, the temporary fix we are currently doing is that we have to re-start Jboss and then the issue with Dremio connectivity gets automatically fixed but if we don’t do that then it stays that way and all the reports fail until we re-start Jboss,

I was wondering if the connection to Dremio is a temporary(Gets initiated according to our need) or permanent,

If there is any fix available for this then can you help us out or if you need some more information please reply back,

Thanks and Regards,
Rohan Bhardwaj.

Hi Rohan,
Based on the similar community post you mentioned, looks like the issue was resolved with driver version 3.0.6. Could you please try the same and see if the issue still occurs?
Thanks,
Payal