Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18494

Natively support SQL Server Integrated Authentication in Bamboo

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • Database (MS SQL)
    • None
    • 4
    • 3
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Problem Definition

      SQL Server Integrated Authentication isn't natively supported in Bamboo 6.0.x since the transition to Microsoft JDBC from JTDS. Integrated authentication allows the driver to login to the database server using Windows / Domain authentication. The credentials are assumed from the Bamboo Service user.

      Attempting to start Bamboo without this required library will cause an error similar to the below:
      {code:java}
      2017-06-22 10:52:35,163 ERROR [localhost-startStop-1] [AbstractUpgradeManager] java.lang.RuntimeException: java.sql.SQLException: Connections could not be acquired from the underlying database!
      java.lang.RuntimeException: java.sql.SQLException: Connections could not be acquired from the underlying database!
      	at com.google.common.base.Throwables.propagate(Throwables.java:160)
      	at com.atlassian.bamboo.upgrade.AbstractBootstrapUpgradeTask.getDatabaseConnection(AbstractBootstrapUpgradeTask.java:47)
      …
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:0147495a-6902-4d38-8253-3cf3287759df
      	at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1748)
      	at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<init>(AuthenticationJNI.java:58)
      …
      Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path
      	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
      	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
      	at java.lang.System.loadLibrary(System.java:1122)
      	at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(AuthenticationJNI.java:32)
      

      Suggested Solution

      Bundle the required libraries for SQL Server Integrated Authentication and provide documentation on how to enable it. Bitbucket Server example:

      Workaround

      This workaround assumes the relevant attributes have already been added to the JDBC connection string in <bamboo-home>/bamboo.cfg.xml. Example:

      <property name="hibernate.connection.url">jdbc:sqlserver://localhost:1433;databaseName=bamboo;integratedSecurity=true</property>
      
      1. Check $BAMBOO_INSTALL\lib to find which version of the Microsoft SQL driver is bundled. For example, Bamboo 9.0 ships with mssql-jdbc-9.4.0.jre8.jar
      2. Find the relevant release for the Microsoft JDBC driver downloads for that version: https://github.com/microsoft/mssql-jdbc/releases
      3. Download the mssql-jdbc_auth.zip for the release that matches the version bundled with Bamboo
      4. Copy the relevant DLL for your platform from the archive (e.g. x86 vs x64)
      5. Place it in a location on the java.library.path. For Windows, this is a location on your %PATH% environment variable or <bamboo-install>\bin

          Form Name

            [BAM-18494] Natively support SQL Server Integrated Authentication in Bamboo

            rables, FYI, you also need to place a copy of the DLL into the <install_dir>\jre\bin directory in order for Synchrony to function (collaborative editing in Confluence).

            IT Administration added a comment - rables , FYI, you also need to place a copy of the DLL into the <install_dir>\jre\bin directory in order for Synchrony to function (collaborative editing in Confluence).

            IT Administration added a comment - - edited

            rables - It should go into the bin directory of your Jira installation directory. In my case: 

            C:\Program Files\Atlassian\Jira\bin
            

            then make sure your dbconfig.xml is located in the application data directory; in my case:

            C:\Program Files\Atlassian\Application Data\Jira
            

            Example of the dbconfig.xml I used:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <jira-database-config>
              <name>defaultDS</name>
              <delegator-name>default</delegator-name>
              <database-type>mssql</database-type>
              <schema-name>dbo</schema-name>
              <jdbc-datasource>
                <url>jdbc:sqlserver://;serverName=SERVER_NAME;databaseName=DB_NAME;integratedSecurity=true;</url>
                <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                <username>domain\username</username>
                <password></password>
                <!-- any additional settings -->
              </jdbc-datasource>
            </jira-database-config>
            

            IT Administration added a comment - - edited rables  - It should go into the bin directory of your Jira installation directory. In my case:  C:\Program Files\Atlassian\Jira\bin then make sure your dbconfig.xml is located in the application data directory; in my case: C:\Program Files\Atlassian\Application Data\Jira Example of the dbconfig.xml I used: <?xml version= "1.0" encoding= "UTF-8" ?> <jira-database-config> <name> defaultDS </name> <delegator-name> default </delegator-name> <database-type> mssql </database-type> <schema-name> dbo </schema-name> <jdbc-datasource> <url> jdbc:sqlserver://;serverName=SERVER_NAME;databaseName=DB_NAME;integratedSecurity=true; </url> <driver-class> com.microsoft.sqlserver.jdbc.SQLServerDriver </driver-class> <username> domain\username </username> <password> </password> <!-- any additional settings --> </jdbc-datasource> </jira-database-config>

            Rob Ables added a comment -

            Alex, where did you place the DLL for Jira to see it?

            Rob Ables added a comment - Alex, where did you place the DLL for Jira to see it?

            IT Administration added a comment - - edited

            in 2020, setting up the latest version of Jira and still encountered this issue. 
            After spending several days of trying every possible configuration and suggestion, this missing DLL finally fixed it.

            It would be great if this missing component could at least be documented in the Jira database documentation

            IT Administration added a comment - - edited in 2020, setting up the latest version of Jira and still encountered this issue.  After spending several days of trying every possible configuration and suggestion, this missing DLL finally fixed it. It would be great if this missing component could at least be documented in the Jira database documentation

              Unassigned Unassigned
              jowen@atlassian.com Jeremy Owen
              Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: