Bitbucket Server fails to connect to SQL Server: The database name component of the object qualifier must be the name of the current database.
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
The following error occurs when attempting to connect to a Microsoft SQL Server database:
1
com.microsoft.sqlserver.jdbc.SQLServerException: The database name component of the object qualifier must be the name of the current database.
Diagnosis
Environment
Microsoft SQL Server
Cause
The database name does not match the name of the Microsoft SQL database. This can occur when an invalid database name is in either the "Database name" field during the migration or setup wizard, or specified in <home-directory>/shared/bitbucket.properties.
The database name is case-sensitive.
Solution
Resolution
Get the name of the database by running this SQL query:
1 2
SELECT name, database_id, create_date FROM sys.databases;
Compare it with the database name you are currently using, depending on weather you are:
Running the migration or setup wizard: Compare with the "Database name" field.
Starting Bitbucket Server normally: Compare with the
<database name>
configured in<home-directory>/shared/bitbucket.properties
: (A restart of Bitbucket Server is required)1
jdbc.url=jdbc:jtds:sqlserver://<host>:<port>/<database name>
Update the database name so that it matches the name of the database from the SQL query (case sensitive)
Was this helpful?