Metabase: Trouble connecting to SQL Server

Created on 31 Jan 2016  路  42Comments  路  Source: metabase/metabase

I've been trying to connect to various SQL Server instances and I am yet to be successful. I'm trying to connect to my local instance, an Azure instance and our production instance (not Azure). For every attempt I get:

Failed to connect to database: Timed out after 5000 milliseconds

I know that it's finding the database because when I turn off the TCP/IP via SQL Server Configuration Manager on my local instance for example, I get this error:

Failed to connect to database: java.sql.SQLException: Network error IOException: Connection refused: connect

Is there a way to enable more logging?
Someone mentioned .database.windows.net in the host, is that something that I should do?

DatabasSQLServer Bug

Most helpful comment

I'm having this problem with latest version 0.24.1

Timed out after 5000 milliseconds.

I think there should not be any problem here since I tested credentials, connections, visibility, etc.
I'm using SSH Tunnel Connection so my guess is that connection takes long and it times out really quickly.....
How can I increase timeout time??

All 42 comments

Hi @iwozzy , so for the sake of simplicity I would suggest first focusing on connecting to a local instance and then expanding from there. Based on what you are saying about the timeout it sounds as if it's just a matter of credentials or some other connection setting that your server doesn't like.

Do you have an example of how you connect when you are not using Metabase? maybe that would give us some clues.

Hey @agilliland, thanks for helping.

I connect either using SQL Server Management Studio or using node-mssql module which I believe uses the TDS protocol.

When I try connecting using Metabase my credentials are correct. I try using both windows authentication method and via the sa user on the database.

The error does not contain any details that would help with diagnosing the problem. Feels like I'm stabbing in the dark at different things.

@iwozzy, @agilliland we are experiencing the same issue connecting with sql authentication.

To update, tried a local instance of SQL Server with the same timeout error. Also tried MSSQL 2008 since our production databases are 2014. Is there any other info I can provide to help?

I'm having the same exact issue on our SQL Server running SQL express. Anyone figure this out?

No, we are still having the same timeout errors.

Same here, haven't been able to connect yet

I'm pretty sure this issue isn't happening on the Mac App version. Only on the JDK and Docker version. Trying to verify that now.

We have tested the JDK version and the Mac app, with the same timeout error.

I was able to successfully connect both of my databases. My issue was with the firewall running on the network. Hope this helps!

@lukeabell that's good news. What specifically was the firewall blocking? Are both of the databases SQL server express?

When the firewall was running, were your able to connect to the db from SQL Server Management Studio?

@camsaul This is not fixed for us

Hey, I'm having a similar issue where I'm able to log in using normal (non-Windows authentication) credentials in SQL Server Mgmt Studio, but using the same credentials I get the "Timed out after 5000 milliseconds" error when I try to connect using Metabase.

Has anyone come up with a solution for this?

I have not, still having same issue.

Make sure you guys have port forwarding set up on the network. That was specifically the problem for me.

_bump_, this is a significant issue for us as well, cannot establish a connection to sql server "Timed out after 5000 milliseconds.", running it on the same machine and with the same credentials as other applications which i can successfully connect to the db with, including within other java apps. would love to get this product up and running! have tried both with a built in sql login and with a windows domain login, without success. Also tried connecting to various servers targets. mostly tried connecting to 2008R2, on custom instances as well as with the default instance

Same issue "Timed out after 5000 milliseconds" when trying to connect to SQL Server. Metabase is installed on Windows

+1 - same issue

Same issue here, SSMS works in a snap, Metabase times out.
Windows 2012R2

@mhartman4 @seedubyaache @davidsirr @jkirkland-cityoflewisville-com @mdaymond @IgalSc

Do you have a firewall running that might be blocking the connection? As @LukeAbell mentioned he was able to resolve this issue by setting up port forwarding.

At any rate we're working on resolving this issue so any other information that might be helpful is greatly appreciated.

Hi no firewalls running on the port specified in the connection page, which is evidenced by the successful connections from other apps on the same machines thanks

No Firewall, SSMS connects with no issue

No firewall, other apps connect without issue to the server.

One thing I think would help is to get a very clear picture of the exact environment/setup being used by those who are affected. We have connected to SQL Server instances from various hosts and not had issues, so there must be something about the setup which is different.

If those who are affected could help out by filling out the below questions that will help us recreate the environment that is causing this so that we can troubleshoot better.

  • I am using the ___________ browser.
  • My computer's OS is ___________.
  • I'm running Metabase ___________. [from the JAR / with the Mac App / on AWS / on Herkou / etc.]
  • My Metabase version is ___________.
  • I am using the 鈥婥hrome/Firefox browser.
  • My computer's OS is Windows 2012R2
  • I'm running Metabase 鈥媐rom the Jar
  • My Metabase version is v0.15.1
  • I am using the __browser. - Have use Safari and Chrome from OS X. Have used IE, Chrome and Firefox from Win10. Have used IE11 from Server 2012R2
  • My computer's OS is _Have tried OS X, Win10, Windows Server 2012R2
  • I'm running Metabase Have tried both JAR and Mac App.
  • My Metabase version is 14.1.0

I am using the Google Chrome v49 browser.
My computer's OS is OSX El Capitan.
I'm running Metabase Mac App.
My Metabase version is v0.15.1.

I have the same problem:
Connection with client sql server: ok
database credentials, SQL: ok
Firewall: ok
Mssql: ok (on the same server, ok connection with Metabase)

  • I am using the NONE browser.
  • My computer's OS is OSX.
  • I'm running Metabase MAC Native APP.
  • My Metabase version is 0.16. (tested again just now)

It turns out there was a bug in our driver that would incorrectly force certain connections to be SSL. This issue is fixed by PR #2286 and will go live in Metabase version 0.16.1, which should be released sometime in the next few days.

excellent, thanks for fixing, I look forward to testing it

Hey everyone, Metabase 0.16.1 has just went live which incorporates a fix for SQL Server connections. Get it here: http://www.metabase.com/start/

I was having this issue running version 0.22.2 but it was definitely a problem on my end and due to my SQL Server instance using a dynamic port for TCP/IP connections (which seems pretty clearly to be what Metabase is using).

For anyone else looking for a quick workaround, you can find the current dynamic port being used from SQL Server Configuration Manager (which, on my computer running Windows 10 and with SQL Server 2012 Express installed is only under the Computer Management and not otherwise listed in the Windows Start menu). Open SQL Server Network Configuration, then Protocols for SQLEXPRESS (where "SQLEXPRESS" is the name of your instance), and then open the Properties for the TCP/IP protocol. Go to the IP Addresses tab and scroll to the very bottom. The TCP Dynamic Ports setting for the IPAll group should show the current port being used.

I know this issue is for SQL Server, but if anyone is running into this problem intermittently on Oracle, check out this StackOverflow article: http://stackoverflow.com/questions/14400595/java-oracledb-connection-taking-too-long-the-first-time

I'm having this problem with latest version 0.24.1

Timed out after 5000 milliseconds.

I think there should not be any problem here since I tested credentials, connections, visibility, etc.
I'm using SSH Tunnel Connection so my guess is that connection takes long and it times out really quickly.....
How can I increase timeout time??

i am using latest version , Yesterday my SQL connection was working perfectly, now i am receiving error cannot connect. I am using MS SQL 2016 on local machine.

Having the same problem.

Have tried using Chrome, Firefox.
Running Metabase from Docker
Metabase DB is Postgres
Metabase version is 0.27.1. Upgraded to see if it would fix the problem, was also having the same issue on 0.26.1

I had the same issue but finally resolved and I鈥檓 able to connect to SQL server. Please:

  1. Ensure that Host is using FQDN (like hostname.domain.com)
  2. Additional JDBC connection string options: integratedSecurity=true

Hope this might solve your issue as well.

Same issue here. Running on v0.28.6. The initial connection timeout is too short to connect to an AWS Postgres instance thus Metabase restarts over and over ...

For more about issues connecting to SQL Server after version 0.25 see #6056. Unfortunately, I still can't connect and this issue still hasn't been assigned to anyone.

Same issue here. Running on v0.29.3,connecting MS SQLserver2008.
I am using the IE11/CHROME browser.
My computer's OS is windows server 2008.
I'm running Metabase v0.29.3. from the JAR
My Metabase version is v0.29.3.

Timed out after 5000 milliseconds.
and
database.js error in line 196
"error creating a database "

I had same issue on Centos server where I was getting below error

_Failed to connect to database: Timed out after 5000 milliseconds._

I was able to solve by installing the Microsoft ODBC Driver for SQL Server on Linux. See below link for steps to install drivers.

https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-RHEL-6-or-Centos-7

Was this page helpful?
0 / 5 - 0 ratings