JDBC creds timeout underneath dremio

  • I have the credentials for snowflake configured for the jdbc driver
  • credentials worked great, until…
  • they timedout

dremio doesn’t recognize this and queries fail - reporting this exception:

com.dremio.common.exceptions.UserException: The JDBC storage plugin failed while trying setup the SQL query.
at com.dremio.common.exceptions.UserException$Builder.build(UserException.java:776) ~[dremio-common-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.exec.store.jdbc.JdbcRecordReader.setup(JdbcRecordReader.java:229) [dremio-ce-jdbc-plugin-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.exec.store.CoercionReader.setup(CoercionReader.java:118) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.op.scan.ScanOperator.setupReaderAsCorrectUser(ScanOperator.java:214) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.op.scan.ScanOperator.setupReader(ScanOperator.java:187) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.op.scan.ScanOperator.setup(ScanOperator.java:173) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.SmartOp$SmartProducer.setup(SmartOp.java:563) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer(Pipe.java:79) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer(Pipe.java:63) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.SmartOp$SmartProducer.accept(SmartOp.java:533) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.StraightPipe.setup(StraightPipe.java:102) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.driver.Pipeline.setup(Pipeline.java:68) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution(FragmentExecutor.java:372) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.exec.fragment.FragmentExecutor.run(FragmentExecutor.java:258) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.exec.fragment.FragmentExecutor.access$1200(FragmentExecutor.java:87) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run(FragmentExecutor.java:658) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.task.AsyncTaskWrapper.run(AsyncTaskWrapper.java:104) [dremio-sabot-kernel-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.task.slicing.SlicingThread.mainExecutionLoop(SlicingThread.java:226) [dremio-ce-sabot-scheduler-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
at com.dremio.sabot.task.slicing.SlicingThread.run(SlicingThread.java:156) [dremio-ce-sabot-scheduler-4.1.0-201912030136020081-49feeb75.jar:4.1.0-201912030136020081-49feeb75]
Caused by: net.snowflake.client.jdbc.SnowflakeReauthenticationRequest: Authentication token has expired. The user must authenticate again.

Other than a restart - can dremio re-authenticate somehow ?

There is actually a Snowflake Connection string fix for this that we use with Snowflake JDBC in Dremio.
I believe it’s CLIENT_SESSION_KEEP_ALIVE=true added to your connection string.

Ref: https://docs.snowflake.net/manuals/user-guide/jdbc-configure.html#other-parameters

awesome - let me try this out! thanks

Better reference: https://github.com/narendrans/dremio-snowflake/issues/19#issuecomment-532736668
As noted in the link above,

Make sure to use v3.0.18+ driver. The latest is 3.9.2 :