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

Bitbucket with MS SQL named server

Koen Jansen January 14, 2019

I'm trying to install Bitbucket with a MS SQL server on a windows server. This SQL Server is running on the same server and has instance name sqlExpress01.

The install of bitbucket went fine. But I get a problem when the setup tried to make a connection to the database.

I read in the documentation that there could be problems with named MS SQL servers.

 

How can I best resolve this problem?

 

Error message

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.DefaultDatabaseMigrationService.validateConfiguration(DefaultDatabaseMigrationService.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 XXXXXX, port 1433 has failed. Error: "Connection refused: connect. 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 XXXXXXX, port 1433 has failed. Error: "Connection refused: connect. 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)

1 answer

1 accepted

0 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 15, 2019

Hello Koen and welcome to the Community!

This error typically means you have not configured MS SQL to allow connection to port 1433 for SQL to communicate. Within your Windows server, please follow these steps:

  1. Open SQL server configuration Manager
  2. Locate SQL Server Network Configuration
    1. Expand the above and select “Protocols for SQLEXPRESS01”
    2. image.png
  3. Under Protocol Name, select TCP/IP
  4. A new window show have opened, within there local your IPv6 or IPv4 Addresses (include loopback/localhost)
    1. For each address, select Active: Yes
    2. For Each address, set the TCP Port to 1433
    3. image.png
  5. Select Apply and OK
  6. You may be presented with a prompt that SQL needs to be restarted, Restart SQL
    1. Ensure you restart SQL, and SQL Browser Service
    2. image.png
    3. If the SQL Browser service is not start, then please do so.

This should allow MS SQL to accept connections over port 1433 which will allow Bitbucket to communicate to the database.Once Bitbucket is configured/connected, you may stop the SQL Browser service.

If you’re still having problems, please let us know.

Regards,
Stephen Sifers

Koen Jansen January 16, 2019

Thanks. This works for me

Like Stephen Sifers likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events