stash cannot connect to database server with multiple databases

I downloaded the trial version of Stash for 64-bit windows and ran the setup choosing the internal database for initial evaluation of the product. My next step was to try migrating to a Microsoft SQL server we already have available that is hosting multiple different databases. When I attempt the migration I get a generic connectivity error. I'm also not super confident in the data I'm inputting in to the migration wizard fields. The server is on the same machine as the Stash installation so I've tried a variety of variations of the computer hostname with and without leading '\\', 127.0.0.1, localhost, and all of those combinations with and without the SQL server name added afterwards (localhost\infinityqs) In the database name field I've tried the database name by itself (stash_db) along with the server name appended to the front. I get the same error every time.

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:210)
	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 127.0.0.1, 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:35)
	com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:207)
	...
The TCP/IP connection to the host 127.0.0.1, 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:190)
	com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:241)
	com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2243)
	...

 

I have a stash user created and added to the db_owner role for the stash_db database. What am I missing? The server is configured correctly since we are currently using it for other production activities.

1 answer

Are you sure that SQL Server is listening on localhost port 1433? It might be that its only listening on the external network address on port 1433 or perhaps not listening on port 1433 at all and is using a different port.

Looks like I overlooked that. The server had been set to use dynamic ports. It looks like Stash can see it now but I'm on to another issue hah. Thank you for the assistance though.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

422 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you