Time out - Snowflake Connection

Good morning community,

Impossible to put in place Snowflake connection in place. I got a "time out" after 10 seconds.
I have tried with several database names, to write in upper or lower case or even change the user.

The main error in the Troubleshooting section is: "ERROR metabase.api.database Cannot connect to Database"

The database exists and the account details are filled in as requested.

In September, the connection worked perfectly.

In the account name section when filling in the contact details, could you tell me what you call Account ID?

Taking the aws region us-west 2:

  1. locator.us-west-2.aws or
  2. organization.us-west-2.aws or
  3. organization. locator.us-west-2.aws ?

Could you tell me what the problem is?

Thanks in advance

[26417322-ae69-4867-b6aa-7b1a495acd9a] 2022-12-28T10:11:32+01:00 ERROR metabase.driver.snowflake (type message)
=> java.lang.String
[26417322-ae69-4867-b6aa-7b1a495acd9a] 2022-12-28T10:11:32+01:00 ERROR metabase.api.database Cannot connect to Database
java.lang.Exception: Timed out after 10.0 s
	at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:53)
	at metabase.driver.util$can_connect_with_details_QMARK_.doInvoke(util.clj:36)
	at clojure.lang.RestFn.invoke(RestFn.java:442)
	at metabase.api.database$test_database_connection.invokeStatic(database.clj:431)
	at metabase.api.database$test_database_connection.doInvoke(database.clj:421)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at metabase.api.database$fn__73352$test_connection_details__73357$fn__73358.invoke(database.clj:478)
	at metabase.api.database$fn__73352$test_connection_details__73357.invoke(database.clj:460)
	at metabase.api.database$fn__73384.invokeStatic(database.clj:498)
	at metabase.api.database$fn__73384.invoke(database.clj:484)
	at compojure.core$wrap_response$fn__32284.invoke(core.clj:160)
	at compojure.core$wrap_route_middleware$fn__32268.invoke(core.clj:132)
	at compojure.core$wrap_route_info$fn__32273.invoke(core.clj:139)
	at compojure.core$wrap_route_matches$fn__32277.invoke(core.clj:151)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296.invoke(core.clj:200)
	at metabase.server.middleware.auth$enforce_authentication$fn__65391.invoke(auth.clj:14)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296.invoke(core.clj:200)
	at compojure.core$make_context$handler__32324.invoke(core.clj:289)
	at compojure.core$make_context$fn__32328.invoke(core.clj:299)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$make_context$fn__32328.invoke(core.clj:300)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$make_context$fn__32328.invoke(core.clj:300)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$make_context$fn__32328.invoke(core.clj:300)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$make_context$fn__32328.invoke(core.clj:300)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$make_context$fn__32328.invoke(core.clj:300)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$make_context$fn__32328.invoke(core.clj:300)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at metabase.api.routes$fn__76516$fn__76519.invoke(routes.clj:56)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296.invoke(core.clj:200)
	at clojure.lang.AFn.applyToHelper(AFn.java:160)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$apply.invoke(core.clj:662)
	at metabase.server.routes$fn__76661$fn__76662.doInvoke(routes.clj:57)
	at clojure.lang.RestFn.invoke(RestFn.java:436)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296.invoke(core.clj:200)
	at compojure.core$make_context$handler__32324.invoke(core.clj:289)
	at compojure.core$make_context$fn__32328.invoke(core.clj:299)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$wrap_route_matches$fn__32277.invoke(core.clj:153)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$wrap_route_matches$fn__32277.invoke(core.clj:153)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at compojure.core$wrap_route_matches$fn__32277.invoke(core.clj:153)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296$f__32297$respond_SINGLEQUOTE___32298.invoke(core.clj:197)
	at metabase.server.routes$fn__76649$fn__76651.invoke(routes.clj:41)
	at compojure.core$routes$fn__32296$f__32297.invoke(core.clj:198)
	at compojure.core$routes$fn__32296.invoke(core.clj:200)
	at metabase.server.middleware.exceptions$catch_uncaught_exceptions$fn__73644.invoke(exceptions.clj:98)
	at metabase.server.middleware.exceptions$catch_api_exceptions$fn__73641.invoke(exceptions.clj:86)
	at metabase.server.middleware.log$log_api_call$fn__77130$fn__77131$fn__77132.invoke(log.clj:209)
	at metabase.driver.sql_jdbc.execute.diagnostic$do_with_diagnostic_info.invokeStatic(diagnostic.clj:15)
	at metabase.driver.sql_jdbc.execute.diagnostic$do_with_diagnostic_info.invoke(diagnostic.clj:9)
	at metabase.server.middleware.log$log_api_call$fn__77130$fn__77131.invoke(log.clj:201)
	at toucan.db$_do_with_call_counting.invokeStatic(db.clj:216)
	at toucan.db$_do_with_call_counting.invoke(db.clj:209)
	at metabase.server.middleware.log$log_api_call$fn__77130.invoke(log.clj:200)
	at metabase.server.middleware.browser_cookie$ensure_browser_id_cookie$fn__80483.invoke(browser_cookie.clj:38)
	at metabase.server.middleware.security$add_security_headers$fn__55251.invoke(security.clj:148)
	at metabase.server.middleware.json$wrap_json_body$fn__79638.invoke(json.clj:62)
	at metabase.server.middleware.json$wrap_streamed_json_response$fn__79656.invoke(json.clj:98)
	at metabase.server.middleware.offset_paging$handle_paging$fn__55275.invoke(offset_paging.clj:42)
	at ring.middleware.keyword_params$wrap_keyword_params$fn__80750.invoke(keyword_params.clj:55)
	at ring.middleware.params$wrap_params$fn__80766.invoke(params.clj:69)
	at metabase.server.middleware.misc$maybe_set_site_url$fn__34391.invoke(misc.clj:59)
	at metabase.server.middleware.session$bind_current_user$fn__45744$fn__45745.invoke(session.clj:262)
	at metabase.server.middleware.session$do_with_current_user.invokeStatic(session.clj:243)
	at metabase.server.middleware.session$do_with_current_user.invoke(session.clj:235)
	at metabase.server.middleware.session$bind_current_user$fn__45744.invoke(session.clj:261)
	at metabase.server.middleware.session$wrap_current_user_info$fn__45731.invoke(session.clj:221)
	at metabase.server.middleware.session$wrap_session_id$fn__45717.invoke(session.clj:167)
	at metabase.server.middleware.auth$wrap_api_key$fn__65399.invoke(auth.clj:27)
	at ring.middleware.cookies$wrap_cookies$fn__80670.invoke(cookies.clj:216)
	at metabase.server.middleware.misc$add_content_type$fn__34374.invoke(misc.clj:27)
	at metabase.server.middleware.misc$disable_streaming_buffering$fn__34399.invoke(misc.clj:76)
	at ring.middleware.gzip$wrap_gzip$fn__80712.invoke(gzip.clj:86)
	at metabase.server.middleware.misc$bind_request$fn__34402.invoke(misc.clj:93)
	at metabase.server.middleware.ssl$redirect_to_https_middleware$fn__80499.invoke(ssl.clj:38)
	at metabase.server$async_proxy_handler$fn__76903.invoke(server.clj:73)
	at metabase.server.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.TimeoutException: Timed out after 10.0 s
	at metabase.util$deref_with_timeout.invokeStatic(util.clj:343)
	at metabase.util$deref_with_timeout.invoke(util.clj:335)
	at metabase.util$do_with_timeout.invokeStatic(util.clj:349)
	at metabase.util$do_with_timeout.invoke(util.clj:346)
	at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:47)
	... 111 more
[26417322-ae69-4867-b6aa-7b1a495acd9a] 2022-12-28T10:11:32+01:00 DEBUG metabase.server.middleware.log POST /api/database 400 10.0 s (1 DB calls) 
{:valid false, :dbname "Timed out after 10.0 s", :message "Timed out after 10.0 s"}

Hi @Zikki
Are you sure it's aws and not azure?
https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#non-vps-account-locator-formats-by-cloud-platform-and-region

Thanks for sharing this doc.

Yes, I'm using AWS.

As you can see from the picture below, what should I replace the "xxxxxxxx" with?

What do you mean by "Account ID" ? locator_name ? organization_name ? Both ?

Screenshot 2022-12-28 at 11.49.03

@Zikki The "Account name" is the "Account Identifier", so it all depends on how your Snowflake is created.

If you are inputting exactly the same as you did in September, then someone might have enabled firewall on Snowflake, which means you'll need to allow Metabase to connect.

Try running this SQL query: SELECT CURRENT_ACCOUNT(), CURRENT_REGION();

Results :

  • nwb29496
  • AWS_US_WEST_2

In "Account name" field, I put : nwb29496.us-west-2.aws
I tried in upper case too.

@Zikki It's not about credentials, Metabase cannot connect, so if the account identifier is correct, then there must be a firewall blocking.

Okay, I will look to the firewall.
Thanks for your answers

Hi @flamber,

Investigating with the firewall, nothing blocks the connection to the Snowflake account.
While doing some research, I saw that you advised someone to try the connection with DBeaver.
I got a message to download "Snowflake JDBC Driver 3.13.6". After the installation, the connection works with DBeaver. So the problem is not Snowflake, but Metabase.

Which version do I need to get ? I try a lot of JDBC Snowflake Driver ...

Actual Configuration:

  • Metabase: 0.42.4
  • JDBC Snowflake Driver: 3.13.10
  • Java: openjdk version "11.0.17" 2022-10-18

Regarding DBeaver, you don't detect the problem of JDBC Snowflake Driver, could you guide me to solve this problem please?

Thanks in advance

@Zikki Are you running DBeaver on the same host running Metabase?
Try upgrading to a newer release of Metabase: https://github.com/metabase/metabase/releases/latest

@flamber, I am running DBeaver & Metabase in local to make tests.

New Configuration:

  • Metabase: 0.45.1
  • JDBC Snowflake Driver: 3.13.10
  • Java: openjdk version "11.0.17" 2022-10-18

Still not working with a newer release of Metabase...

@Zikki Okay, I don't know what the problem is, but post the JDBC connection string generated by DBeaver. I'm guessing the problem is incorrect account identifier.

@flamber Here the JDBC connection from DBeaver

@Zikki Then just input nwb29496 into the "Account name", since you are using Oregon location.

@flamber Thanks a lot ! Sorry I misread the Snowflake documentation with Oregon region ...

@Zikki Trust me, you're not the first. I think this is one of the most confusing parts of Snowflake. I know they've tried to fix it, but that almost made it worse, since there's now "new" and "legacy" stuff.

1 Like

@flamber Thank you for your time :slight_smile:

I hope this thread will help the Metabase community !