Login failed for user while trying to connect Bamboo to a database
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
When trying to connect Bamboo with a database, the Bamboo logs (<bamboo-home>/logs/atlassian-bamboo.log
) show the following error:
Failed to initialize pool: Login failed for user 'User-Name'
Environment
Observed while upgrading Bamboo from version 6.5 to 9.0.0, with Microsoft SQL Server as the external database.
Diagnosis
Looking at the <bamboo-home>/logs/atlassian-bamboo.log
the bellow error messages can be seen:
INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating connection to url: [jdbc:sqlserver://server:1433;databaseName=XXXXX]
ERROR [performSetupDatabaseConnectionBackgroundThread] [DefaultAtlassianBootstrapManager] Could not successfully test your database:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'User-Name'. ClientConnectionId:zx70e792-2cks-4b20-a231-90j23j7fdlc2
Cause
The issue can happen if the username and/or password connecting to the database are incorrect.
Solution
Please check with your Database Administrator if the username and password are correct. Also, please verify if you can connect to the database using the credentials.
It's important to remember that Bamboo will try to connect to the database using the credentials configured in the <bamboo-home>/bamboo.cfg.xml
file, on the following lines.
<property name="hibernate.connection.password">XXXXX</property>
...
<property name="hibernate.connection.username">XXXXX</property>
If the password or username needs to be adjusted, it should be done on those lines.