Timed out after 10s:Sql server connection error

I'm trying to connect metabase with sql server 12.0.4100.1
but getting this error.
bellow is the error message that comes in the cmd window where metabase runs.

2021-10-26 13:12:09,764 ERROR driver.util :: Database connection error
java.util.concurrent.TimeoutException: Timed out after 10.0 s

at metabase.util$deref_with_timeout.invokeStatic(util.clj:345)
at metabase.util$deref_with_timeout.invoke(util.clj:337)
at metabase.util$do_with_timeout.invokeStatic(util.clj:351)
at metabase.util$do_with_timeout.invoke(util.clj:348)
at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:42)
at metabase.driver.util$can_connect_with_details_QMARK_.doInvoke(util.clj:31)
..................

2021-10-26 13:12:09,773 ERROR 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:48)
at metabase.driver.util$can_connect_with_details_QMARK_.doInvoke(util.clj:31)
.....

Caused by: java.util.concurrent.TimeoutException: Timed out after 10.0 s
at metabase.util$deref_with_timeout.invokeStatic(util.clj:345)
..........
2021-10-26 13:12:19,793 ERROR 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:48)
..............
Caused by: java.util.concurrent.TimeoutException: Timed out after 10.0 s
at metabase.util$deref_with_timeout.invokeStatic(util.clj:345)
at metabase.util$deref_with_timeout.invoke(util.clj:337)
at metabase.util$do_with_timeout.invokeStatic(util.clj:351)
at metabase.util$do_with_timeout.invoke(util.clj:348)
at metabase.driver.util$can_connect_with_details_QMARK_.invokeStatic(util.clj:42)
... 116 more
2021-10-26 13:12:19,802 DEBUG middleware.log :: POST /api/database 400 20.0 s (0 DB calls)
{:valid false, :dbname "Timed out after 10.0 s", :message "Timed out after 10.0 s"}

Here is the user credentials

**Note that: ***I can connect to DB server using the same user credentials in * Microsoft SQL server management studio

Hi @nkimran94
Post "Diagnostic Info" from Admin > Troubleshooting.

{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "Cp1252",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "16.0.2+7",
"java.vendor": "Eclipse Foundation",
"java.vendor.url": "https://adoptium.net/",
"java.version": "16.0.2",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "16.0.2+7",
"os.name": "Windows 10",
"os.version": "10.0",
"user.language": "en",
"user.timezone": "Asia/Dhaka"
},
"metabase-info": {
"databases": [
"h2"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2021-10-21",
"tag": "v0.41.1",
"branch": "release-x.41.x",
"hash": "76aa4a5"
},
"settings": {
"report-timezone": null
}
}
}

@nkimran94
Install Java 11: https://www.metabase.com/docs/latest/operations-guide/java-versions.html
And check firewall/antivirus, since it's likely blocking, if you are sure that host and port is correct.
And migrate away from H2 if you're using Metabase in production:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

@flamber
getting this error while connecting to remote sql server:
The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]". ClientConnectionId:f6ee9acc-a9ce-4b23-98be-a35841aea960

@nkimran94 Have a look here: TLS10 error when trying to connect to older SQL Server

1 Like