I am writing a Metabase driver plugin to Dremio.
I have already installed the Dremio JDBC driver with the Clojure project.
Now I am trying to implement the multifunction for sql-jdbc.conn/connection-details->spec
My code looks like this:
(defmethod sql-jdbc.conn/connection-details->spec :dremio
[_ {:keys [user password db host port instance ssl]
:or {user “dbuser”, password “dbpassword”, db “”, host “localhost”}
:as details}]
(-> {:applicationName config/mb-app-id-string
:url host
:subprotocol “dremio”
:dbname db
:database db
:password password
:classname “com.dremio.jdbc.Driver”
:connection-uri “jdbc:dremio:direct=127.0.0.1:31010”
:user user
:instanceName instance
:encrypt (boolean ssl)
(sql-jdbc.common/handle-additional-options details, :seperator-style :semicolon)))
The connection-url property should override some of the database connection attributes.
I am running Dremio locally on a Docker container, with the Dremio services at port 31010.
However, when I do the Metabase setup, entering connection attributes in the “Add your data” section, and hit the “Next” button, I would get the following “Connection Refused” error message from the Metabase logs:
ERROR rpc.BasicClient :: Failed to establish connection
java.util.concurrent.ExecutionException: cdjd.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:31010
at cdjd.io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:54)
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionEstablishmentListener.operationComplete(BasicClient.java:284)
at cdjd.com.dremio.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionEstablishmentListener.operationComplete(BasicClient.java:272)
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:500)
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:493)
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:472)
at cdjd.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:413)
at cdjd.io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:538)
at cdjd.io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:531)
at cdjd.io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:111)
at cdjd.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:323)
at cdjd.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:339)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:685)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
at cdjd.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
at cdjd.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
at cdjd.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
at cdjd.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: cdjd.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:31010
Caused by: java.net.ConnectException: Connection refused
I have tried countless permutations of the connection attributes.
Only this permutation, with this connection-url, produces the “Connection refused” error.
Most of the others would produce a TimeoutException, suggesting that the service does not exist.
So I suspect that my connection string is correct, but its request is just not reaching the Dremio service.
What could be going on? Please help!