metabase-clickhouse-driver
metabase-clickhouse-driver copied to clipboard
Error in the connection causes Snowflake exception
Describe the bug
When there's an error in the connection, the exception thrown is "Caused by: net.snowflake.client.jdbc.SnowflakeSQLException: Connection string is invalid. Unable to parse."
Steps to reproduce
- raise https://github.com/paoliniluis/metabase-clickhouse
- create a new connection to clickhouse but with an error on some parameter, see the error
Expected behaviour
The exception thrown should be a Clickhouse one, and on the specific parameter
Error log
metabase-snowflake | 2023-06-12 22:30:26,533 ERROR api.database :: Cannot connect to Database
metabase-snowflake | clojure.lang.ExceptionInfo: Connection string is invalid. Unable to parse. {:message "Connection string is invalid. Unable to parse."}
metabase-snowflake | at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:159)
metabase-snowflake | at metabase.driver.util$can_connect_with_details_QMARK_.doInvoke(util.clj:132)
metabase-snowflake | at clojure.lang.RestFn.invoke(RestFn.java:442)
metabase-snowflake | at metabase.api.database$test_database_connection.invokeStatic(database.clj:677)
metabase-snowflake | at metabase.api.database$test_database_connection.doInvoke(database.clj:667)
metabase-snowflake | at clojure.lang.RestFn.invoke(RestFn.java:425)
metabase-snowflake | at metabase.api.database$fn__95755$test_connection_details__95760$fn__95761.invoke(database.clj:730)
metabase-snowflake | at metabase.api.database$fn__95755$test_connection_details__95760.invoke(database.clj:711)
metabase-snowflake | at metabase.api.database$fn__95788.invokeStatic(database.clj:749)
metabase-snowflake | at metabase.api.database$fn__95788.invoke(database.clj:735)
metabase-snowflake | at compojure.core$wrap_response$fn__42386.invoke(core.clj:160)
metabase-snowflake | at compojure.core$wrap_route_middleware$fn__42370.invoke(core.clj:132)
metabase-snowflake | at compojure.core$wrap_route_info$fn__42375.invoke(core.clj:139)
metabase-snowflake | at compojure.core$wrap_route_matches$fn__42379.invoke(core.clj:151)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$wrap_route_matches$fn__42379.invoke(core.clj:152)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at metabase.server.middleware.auth$enforce_authentication$fn__87496.invoke(auth.clj:17)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at compojure.core$make_context$handler__42426.invoke(core.clj:290)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:300)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:199)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:199)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:199)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at metabase.api.routes$fn__99305$fn__99306.invoke(routes.clj:62)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at clojure.lang.AFn.applyToHelper(AFn.java:160)
metabase-snowflake | at clojure.lang.AFn.applyTo(AFn.java:144)
metabase-snowflake | at clojure.core$apply.invokeStatic(core.clj:667)
metabase-snowflake | at clojure.core$apply.invoke(core.clj:662)
metabase-snowflake | at metabase.server.routes$fn__99466$fn__99467.doInvoke(routes.clj:70)
metabase-snowflake | at clojure.lang.RestFn.invoke(RestFn.java:436)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at compojure.core$make_context$handler__42426.invoke(core.clj:290)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:300)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$wrap_route_matches$fn__42379.invoke(core.clj:153)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$wrap_route_matches$fn__42379.invoke(core.clj:153)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$wrap_route_matches$fn__42379.invoke(core.clj:153)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:199)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399$respond_SINGLEQUOTE___42400.invoke(core.clj:197)
metabase-snowflake | at compojure.core$make_context$fn__42430.invoke(core.clj:301)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at compojure.core$routes$fn__42398$f__42399.invoke(core.clj:198)
metabase-snowflake | at compojure.core$routes$fn__42398.invoke(core.clj:200)
metabase-snowflake | at metabase.server.middleware.exceptions$catch_uncaught_exceptions$fn__96098.invoke(exceptions.clj:103)
metabase-snowflake | at metabase.server.middleware.exceptions$catch_api_exceptions$fn__96095.invoke(exceptions.clj:91)
metabase-snowflake | at metabase.server.middleware.log$log_api_call$fn__102763$fn__102764$fn__102765.invoke(log.clj:216)
metabase-snowflake | at metabase.driver.sql_jdbc.execute.diagnostic$do_with_diagnostic_info.invokeStatic(diagnostic.clj:18)
metabase-snowflake | at metabase.driver.sql_jdbc.execute.diagnostic$do_with_diagnostic_info.invoke(diagnostic.clj:12)
metabase-snowflake | at metabase.server.middleware.log$log_api_call$fn__102763$fn__102764.invoke(log.clj:208)
metabase-snowflake | at toucan2.execute$do_with_call_counts.invokeStatic(execute.clj:112)
metabase-snowflake | at toucan2.execute$do_with_call_counts.invoke(execute.clj:103)
metabase-snowflake | at metabase.server.middleware.log$log_api_call$fn__102763.invoke(log.clj:207)
metabase-snowflake | at metabase.server.middleware.browser_cookie$ensure_browser_id_cookie$fn__109486.invoke(browser_cookie.clj:42)
metabase-snowflake | at metabase.server.middleware.security$add_security_headers$fn__80352.invoke(security.clj:153)
metabase-snowflake | at metabase.server.middleware.json$wrap_json_body$fn__106738.invoke(json.clj:67)
metabase-snowflake | at metabase.server.middleware.offset_paging$handle_paging$fn__80376.invoke(offset_paging.clj:45)
metabase-snowflake | at metabase.server.middleware.json$wrap_streamed_json_response$fn__106756.invoke(json.clj:103)
metabase-snowflake | at ring.middleware.keyword_params$wrap_keyword_params$fn__109753.invoke(keyword_params.clj:55)
metabase-snowflake | at ring.middleware.params$wrap_params$fn__109772.invoke(params.clj:77)
metabase-snowflake | at metabase.server.middleware.misc$maybe_set_site_url$fn__50518.invoke(misc.clj:61)
metabase-snowflake | at metabase.server.middleware.session$reset_session_timeout$fn__63863.invoke(session.clj:441)
metabase-snowflake | at metabase.server.middleware.session$bind_current_user$fn__63832$fn__63833.invoke(session.clj:336)
metabase-snowflake | at metabase.server.middleware.session$do_with_current_user.invokeStatic(session.clj:315)
metabase-snowflake | at metabase.server.middleware.session$do_with_current_user.invoke(session.clj:304)
metabase-snowflake | at metabase.server.middleware.session$bind_current_user$fn__63832.invoke(session.clj:335)
metabase-snowflake | at metabase.server.middleware.session$wrap_current_user_info$fn__63813.invoke(session.clj:285)
metabase-snowflake | at metabase.server.middleware.session$wrap_session_id$fn__63796.invoke(session.clj:217)
metabase-snowflake | at metabase.server.middleware.auth$wrap_api_key$fn__87504.invoke(auth.clj:30)
metabase-snowflake | at ring.middleware.cookies$wrap_cookies$fn__109673.invoke(cookies.clj:216)
metabase-snowflake | at metabase.server.middleware.misc$add_content_type$fn__50500.invoke(misc.clj:29)
metabase-snowflake | at metabase.server.middleware.misc$disable_streaming_buffering$fn__50526.invoke(misc.clj:78)
metabase-snowflake | at ring.middleware.gzip$wrap_gzip$fn__109715.invoke(gzip.clj:86)
metabase-snowflake | at metabase.server.middleware.misc$bind_request$fn__50529.invoke(misc.clj:95)
metabase-snowflake | at metabase.server.middleware.ssl$redirect_to_https_middleware$fn__109502.invoke(ssl.clj:41)
metabase-snowflake | at metabase.server$async_proxy_handler$fn__101529.invoke(server.clj:77)
metabase-snowflake | at metabase.server.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
metabase-snowflake | at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:173)
metabase-snowflake | at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
metabase-snowflake | at org.eclipse.jetty.server.Server.handle(Server.java:563)
metabase-snowflake | at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
metabase-snowflake | at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
metabase-snowflake | at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
metabase-snowflake | at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
metabase-snowflake | at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
metabase-snowflake | at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
metabase-snowflake | at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
metabase-snowflake | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:416)
metabase-snowflake | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:385)
metabase-snowflake | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:272)
metabase-snowflake | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:140)
metabase-snowflake | at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
metabase-snowflake | at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:936)
metabase-snowflake | at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1080)
metabase-snowflake | at java.base/java.lang.Thread.run(Unknown Source)
metabase-snowflake | Caused by: net.snowflake.client.jdbc.SnowflakeSQLException: Connection string is invalid. Unable to parse.
metabase-snowflake | at net.snowflake.client.jdbc.SnowflakeDriver.connect(SnowflakeDriver.java:178)
metabase-snowflake | at metabase.plugins.jdbc_proxy$proxy_driver$reify__79670.connect(jdbc_proxy.clj:37)
metabase-snowflake | at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
metabase-snowflake | at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
metabase-snowflake | at clojure.java.jdbc$get_driver_connection.invokeStatic(jdbc.clj:271)
metabase-snowflake | at clojure.java.jdbc$get_driver_connection.invoke(jdbc.clj:250)
metabase-snowflake | at clojure.java.jdbc$get_connection.invokeStatic(jdbc.clj:411)
metabase-snowflake | at clojure.java.jdbc$get_connection.invoke(jdbc.clj:274)
metabase-snowflake | at clojure.java.jdbc$db_query_with_resultset_STAR_.invokeStatic(jdbc.clj:1111)
metabase-snowflake | at clojure.java.jdbc$db_query_with_resultset_STAR_.invoke(jdbc.clj:1093)
metabase-snowflake | at clojure.java.jdbc$query.invokeStatic(jdbc.clj:1182)
metabase-snowflake | at clojure.java.jdbc$query.invoke(jdbc.clj:1144)
metabase-snowflake | at clojure.java.jdbc$query.invokeStatic(jdbc.clj:1160)
metabase-snowflake | at clojure.java.jdbc$query.invoke(jdbc.clj:1144)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$can_connect_with_spec_QMARK_.invokeStatic(connection.clj:302)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$can_connect_with_spec_QMARK_.invoke(connection.clj:299)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$can_connect_QMARK_$fn__50138.invoke(connection.clj:311)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$do_with_connection_spec_for_testing_connection$fn__50120.invoke(connection.clj:287)
metabase-snowflake | at metabase.util.ssh$do_with_ssh_tunnel.invokeStatic(ssh.clj:141)
metabase-snowflake | at metabase.util.ssh$do_with_ssh_tunnel.invoke(ssh.clj:130)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$do_with_connection_spec_for_testing_connection.invokeStatic(connection.clj:285)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$do_with_connection_spec_for_testing_connection.invoke(connection.clj:281)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$can_connect_QMARK_.invokeStatic(connection.clj:310)
metabase-snowflake | at metabase.driver.sql_jdbc.connection$can_connect_QMARK_.invoke(connection.clj:306)
metabase-snowflake | at metabase.driver.sql_jdbc$fn__111449.invokeStatic(sql_jdbc.clj:43)
metabase-snowflake | at metabase.driver.sql_jdbc$fn__111449.invoke(sql_jdbc.clj:41)
metabase-snowflake | at clojure.lang.MultiFn.invoke(MultiFn.java:234)
metabase-snowflake | at metabase.driver.util$can_connect_with_details_QMARK_$fn__46851.invoke(util.clj:144)
metabase-snowflake | at clojure.core$binding_conveyor_fn$fn__5823.invoke(core.clj:2047)
metabase-snowflake | at clojure.lang.AFn.call(AFn.java:18)
metabase-snowflake | at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
metabase-snowflake | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
metabase-snowflake | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
Configuration
Environment
- metabase-clickhouse-driver version: 1.1.6
- metabase-clickhouse-driver configuration:
- Metabase version: 1.46.4
- OS: docker on pop-os lts
ClickHouse server
- ClickHouse Server version: 22
- ClickHouse Server non-default settings, if any: none
-
CREATE TABLE
statements for tables involved: - Sample data for all these tables, use clickhouse-obfuscator if necessary