Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you setup the database part when you install Bitbucket Server on a windows server?

niyazi ozturk June 12, 2018

I am at the initial stage of installing BitBucket Server for a small team. In the options I chose the "external" and the message I got was..

The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again.

If you continue having issues, get in touch with our support team and we'll help get you up and running

"com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:214)
...
The TCP/IP connection to the host , port 1433 has failed. Error: "Connection refused: no further information. 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"

3 answers

1 vote
Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2018

Hi Niyazi,

Most likely you're running into an oddity in SQL Server, which by default has TCP disabled, so it won't listen on port 1433.

You need to enable TCP in SQL Server, and how to do that is described in https://www.habaneroconsulting.com/stories/insights/2015/tcpip-is-disabled-by-default-in-microsoft-sql-server-2014

Cheers,

Christian

Premier Support Engineer

Atlassian

niyazi ozturk June 14, 2018
  • Solution that I followed 
  • I discovered that my connection was failing because of the SQL-Server setup (it took me a while to get there though!!!)
  • I change the SQL-Server authentication type to Both SQL-Server and Windows authenticated type, instead of integrated windows option. (Select the top server icon in the SSMS and open properties, and go to security options from the list and in the opening panel, under the security section, check the second option that says SQL Server and Windows Authentication mode)
  • Also, previously I changed the TCP-IP enabling as your provided link explained
  • For case sensitivity problem I ran this SQL command in SQL-Server MS 

SQL Server> ALTER DATABASE bitbucket COLLATE  SQL_Latin1_General_CP1_CS_AS;

 

The whole Atlassian team has been "Fantastic", UUge team, UUge thanks... :-)

0 votes
niyazi ozturk June 14, 2018
  • Enable the TCP-IP connectivity for SQL Server by using the SQL Server configuration Manager
  • Change (Check it first) the SQL Server's authentication to be able to do both (it is one option in the properties of SSrvr) SQL Server and Windows mode
  • If you have the case insensitivity issue, as I described above (like the other resources also) run the SQL command by replacing the database name (I said bitbucket, easy) you created for your Bitbucket Server installation. (I think you get the same problem for the DB Migration too after the evaluation stage because it is the same screen)
0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2018

Hello,

What database do you use? What is the configuration string? Are you sure that the database if up and running?

If you use an external database then you should install a database first.

niyazi ozturk June 14, 2018

 

Hi Alexey, thanks for your reply. 

I have a fully running SQL-Server running in 3 diff places, on my laptop, desktop and workplace. The DB is fully functional, I also develop SSRS reports and DB works. Created the user as it was required in the documents. Granted the permissions. Enabled the TCP/IP stuff. Despite all, I watched this ( https://www.youtube.com/watch?v=sY47JJN8SH4 ) video and I don't think I am doing anything wrong (!), but somehow somewhere something is missing. Meanwhile, I also installed Mic SQL JDBC driver too. 

I will dig in a bit more and if I solve it somehow I will share it with you.

 

Again thank you so much for your interest to help.

Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 14, 2018

Hi Niyazi,

There is definitely a network issue of some sort - either SQL Server isn't listening on port 1433 or there's a firewall between Bitbucket Server and SQL Server that's preventing access to it.

Cheers,

Christian

Premier Support Engineer

Atlassian

niyazi ozturk June 14, 2018

Hi Christian,

Thank for your help,

In the SQL-Server error log (which you can read it through SSMstudio), it says "The server is configured for integrated authentication only" ..

Do you think this is the problem? 

I have been trying to change it by using Sql-Server tools but couldn't find a way to repair it. 

Meanwhile, I did enable the TCP-IP stuff you mentioned and was going to let you know that I have tried and it didn't work. 

UUge UUge (trump version) thanks...

--- UPDATE -- 5Min later

I have changed the authentication type for the Bitbucket (empty db) that I created in SQL Server by using the SSMS as described in this page 

https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/change-server-authentication-mode?view=sql-server-2017

and then restarted the SQL-Server from the SQL-Server configuration manager and the connection is solved. :-) but, "Sydney, I have got a problem"... Case sensitivity problem. 

it is supposed to be SQL_Latin1_General_CP1_CS_AS..and IT IS, (!) but somehow it says there is a problem...!!

getting there :-) almost..

 

niyazi ozturk June 14, 2018

when you receive this famous message 

 

Bitbucket Server requires a case-sensitive database, but the target database is case-insensitive.

You look at the database properties and it says SQL_Latin1_General_CP1_CS_AS  

and you change it from the options and say ok.. but still doesn't work ...

Untill you run this command as an SQL command from SQL-Server MS.. 

open up a new query window and run this 

SQL Server> ALTER DATABASE Bitbucket COLLATE  SQL_Latin1_General_CP1_CS_AS;

 

Thanks Christian!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events