MS SQL Host unreachable from docker instance

Hi,

I set up metabase with docker for initial testing, so it still uses the H2.

I cannot connect to a SQL Server instance over the network.
It says:

The TCP/IP connection to the host xx.xx.xx.xx, port 1433 has failed. Error: "Host is unreachable (Host unreachable). 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.".

I CAN connect to this specific host with sql server management studio and other tools.
The strange thing: When I try to connect to a sql server instance on my local machine (192.168....) it works.

Any ideas?

Thanks
Sascha

{
"browser-info": {
"language": "de",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.26",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.16.1+1",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.16.1",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.16.1+1",
"os.name": "Linux",
"os.version": "5.10.102.1-microsoft-standard-WSL2",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2",
"sqlserver",
"googleanalytics"
],
"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": "2022-10-17",
"tag": "v0.44.5",
"branch": "release-x.44.x",
"hash": "29fab4d"
},
"settings": {
"report-timezone": null
}
}
}

Hi @SaschaW
You are running Metabase inside of a container, so if you are trying to access the host, then you need to reference the right IP https://stackoverflow.com/questions/28056522/access-host-database-from-a-docker-container and network https://docs.docker.com/network/

If you are not familiar with Docker (and WSL2), then it's likely easier to use JAR on WSL2, so there's one less containerization going on.

And make sure that you don't have firewalls blocking traffic.

I would say I'm very familiar with docker :stuck_out_tongue: thats why I am wondering why the outbound traffic behaves different... And the case that is not working is with the ip of another machine, that shouldn't be affected by any docker networking stuff (bridge network). But I can try the jar within wsl, thanks for that hint!

@SaschaW If you are familiar with Docker, then I guess the "fun" comes from WSL2 or perhaps outgoing firewall in Windows.