Can't connect to SQL Server

I have try to add my SQL Server database connection using the standard parameter and I have this error
2021-07-13 14:17:31,349 DEBUG middleware.log :: POST /api/database 400 19.1 s (0 DB calls)
{:valid false,
"The TCP/IP connection to the host ch02vwqasrv0003, port 1433 has failed. Error: "Connection refused (Connection refused). Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".",

If I try to access to my database with dbweaver it works.
Could you help me ? I am made something wrong ....


See the diagnostic info below
"browser-info": {
"language": "en-GB",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
"vendor": "Google Inc."
"system-info": {
"file.encoding": "UTF-8",
"": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.11+9",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "",
"java.version": "11.0.11",
"": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.11+9",
"": "Linux",
"os.version": "3.10.0-862.14.4.el7.x86_64",
"user.language": "en",
"user.timezone": "GMT"
"metabase-info": {
"databases": [
"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-07-08",
"tag": "v0.40.0",
"branch": "master",
"hash": "961caed"
"settings": {
"report-timezone": null

Some screenshot of my configuration

Hi @cperrier
It looks like you're running Metabase in a Docker container, so unless the container knows that hostname, then that's why you can connect with DBeaver (which you're likely not running in Docker).
Use the JAR version of Metabase if you're not familiar with Docker.

I have try from the docker container and I am able to contact the hosname, but perhaps you are right it is an issue with docker and perhaps the port is not open on the container

I will keep you update on my test

So you went into the container - example docker exec -ti metabase bash
And is able to run ping THEHOSTNAME from inside of the container?
Otherwise try nc -v THEHOSTNAME 1433 which tells you if it might be a firewall that is blocking.

I have try to install the jar version and I have the same issue.
I will check your command in docker

I execute the first command and it works
-bash-4.2$ docker exec -it ae8053c147ec bash
bash-5.1# ping ch02vwqasrv0003
PING ch02vwqasrv0003 ( 56 data bytes
64 bytes from seq=0 ttl=127 time=3.463 ms
64 bytes from seq=1 ttl=127 time=1.924 ms
64 bytes from seq=2 ttl=127 time=11.244 ms

With the second it run nothing
-bash-4.2$ docker exec -it ae8053c147ec bash
bash-5.1# nc -v ch02vwqasrv0003 1433

@cperrier Okay, but your screenshot shows it using ch02vwqasrv0003\GTCASH as hostname.
Could that be the problem?

I found the problem the port 1521 was not configure for JDBC connectrion.
I have use other port configure on SQL server.

Thanks and now it works

1 Like