Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

the configuration entered is not valid MS SQL

Sajith Jayaratne January 30, 2017

Hi,

I am going through the setup wizard to connect Bitbucket to MS SQL. However, when I enter the details of the DB server, I keep getting the following:

The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again.
	com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:217)
	com.atlassian.stash.internal.migration.DefaultMigrationService.validateConfiguration(DefaultMigrationService.java:85)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	...
Could not get JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host DELTONEFS, port 1433 has failed. Error: "connect timed out. 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.".
	org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
	com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:44)
	com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:214)
	...
The TCP/IP connection to the host DELTONEFS, port 1433 has failed. Error: "connect timed out. 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.".
	com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:191)
	com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:242)
	com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2369)

 

I am able to connect to the DB from another machine with the same information so not sure what I am missing.

Thanks

Saj

13 answers

0 votes
Sajith Jayaratne February 6, 2017

I was finally able to connect to the database with the help of the following article:

https://confluence.atlassian.com/bitbucketserverkb/connecting-to-named-instances-in-sql-server-from-bitbucket-server-779171681.html

My MS SQL is a named instance so after creating the bitbucket.properties file with the info from the link and restarting the service, it connected to the database.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2017

I am sorry, I was unclear.

What do the MS-SQL Server logs say the problem is?  Why is the server choosing to reject the connection?

What you call MS-SQL is a client that doesn't use the plain basic connection settings that the jdbc driver does, so it's not really a good test of the settings you have.

0 votes
Sajith Jayaratne February 6, 2017

Hi Nic,

Sorry but this site only allows me to make 2 comments per day so it's really hard to keep going with the troubleshooting.

The error log is the one that I posted initially in my question. MS-SQL happily connects to the database in question.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2017

Does the log give us the exact reason for rejection?

Also, what do the logs for MS-SQL say?  It should be logging any attempt to connect to it, and why it rejects it.

0 votes
Sajith Jayaratne February 1, 2017

That thought went through my mind and I changed it to the name of the server first and then tried with the IP addressBitBucket Screenshot 2.png only but I still get the same result

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2017

Ok, I had the wrong idea there, but the first screenshot makes it clear.

You've not entered a host name in the host name field.  You've put in a connection via lookup name, which is useless for looking up the name of the database server on the network.

Try changing it to the name of the database server.  Or even the ip address if you're not sure.

0 votes
Sajith Jayaratne February 1, 2017

BitBucket Screenshot.png

SQLManagement Screenshot.png

These are the two screen compared.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2017

Ok, excellent test.  Now, what's the difference between the parameters you use to connect in there, and what you enter into JIRA.

0 votes
Sajith Jayaratne February 1, 2017

Thanks Nic. I have installed SQL Server Management console on this machine to see if I can connect to the database located in other server and it connects fine. 

0 votes
engenhariaa January 31, 2017

Here it worked well after doing two things:

1) Release external access in mysql from the other server
sudo nano /etc/mysql/my.cnf
Change "bind-address" value from "127.0.0.1" to "0.0.0.0"

2) Release MYSQL port
Iptables -A INPUT -p tcp -dport 3306 -j ACCEPT

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 31, 2017

That's two problems it might have.

  1. Your database server was only listening to the local machine.  0.0.0.0 is "all ip4 connections from the world" which might not be desirable in terms of security, but fixes the issue
  2. You opened up a firewall port that was needed.

Unfortunately, without knowing the setup or doing further testing we can't know what the problem is on the poster's system.

Plus, they're on MS-SQL, so neither point really applies as MS-SQL doesn't use my.cnf and Windows firewalls are not based on iptables.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2017

What about the comparison with a service that works?

0 votes
Sajith Jayaratne January 30, 2017

I am going through port 1433 and I have completely turned off the firewall on the machine that has the SQL DB. 

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2017

If the same settings work on another jdbc based connection, then it's your firewalls or network settings.

If your other system is not using identical methods to connect (by which I mean Bitbucket has a connection string, username, password etc, and your other system is using a different format like host, port, username, password, or something else), then can you show us the comparison you've made?  What do they both look like?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events