Metabase Spark SQL connection to Databricks throughs Invalid SessionHandle Error

Hi All,

We have established a connection from Metabase to Databricks through (sprak sql databricks connector).Now we could able to see the database tables and query the data from metabase UI.

But what we see is ,in between there is below error that frequently pops up(Query used: select * from table_name limit 100):

[Simba]SparkJDBCDriver ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, infoMessages:[*org.apache.hive.service.cli.HiveSQLException:Invalid SessionHandle: SessionHandle [6baeb84f-c991-4c02-9729-69b1bfb2c613]:37:36, org.apache.hive.service.cli.session.SessionManager:getSession:SessionManager.java:287, org.apache.hive.service.cli.CLIService:executeStatementAsync:CLIService.java:274, org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:436, org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1313, org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1298, org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39, org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39, org.apache.thrift.server.TServlet:doPost:TServlet.java:83, org.apache.hive.service.cli.thrift.ThriftHttpServlet:doPost:ThriftHttpServlet.java:184, javax.servlet.http.HttpServlet:service:HttpServlet.java:707, javax.servlet.http.HttpServlet:service:HttpServlet.java:790, org.eclipse.jetty.servlet.ServletHolder:handle:ServletHolder.java:848, org.eclipse.jetty.servlet.ServletHandler:doHandle:ServletHandler.java:584, org.eclipse.jetty.server.handler.ScopedHandler:handle:ScopedHandler.java:143, org.eclipse.jetty.security.SecurityHandler:handle:SecurityHandler.java:548, org.eclipse.jetty.server.session.SessionHandler:doHandle:SessionHandler.java:226, org.eclipse.jetty.server.handler.ContextHandler:doHandle:ContextHandler.java:1180, org.eclipse.jetty.servlet.ServletHandler:doScope:ServletHandler.java:512, org.eclipse.jetty.server.session.SessionHandler:doScope:SessionHandler.java:185, org.eclipse.jetty.server.handler.ContextHandler:doScope:ContextHandler.java:1112, org.eclipse.jetty.server.handler.ScopedHandler:handle:ScopedHandler.java:141, org.eclipse.jetty.server.handler.HandlerWrapper:handle:HandlerWrapper.java:134, org.eclipse.jetty.server.Server:handle:Server.java:534, org.eclipse.jetty.server.

Once we restart metabase its resolved but error pops up again in between data queries.Please let us know how we can resolve this.

Hi @chandan
I’m not sure what’s going on, but you might want to open an issue in the driver repo:
https://github.com/fhsgoncalves/metabase-sparksql-databricks-driver
Looks like it’s having problems with the session handling, which could be caused by how Metabase uses async connections.

@flamber, thank you! I have opened below issue in driver repo:

https://github.com/fhsgoncalves/metabase-sparksql-databricks-driver/issues/2

Hope it gets resolved soon