JIRA and SQL Server 2017 and Windows Authentication

Has anyone setup JIRA to use a SQL Server database with Windows Authentication? If so, can you send me the <url> from your dbconfig.xml? You can blank out the serverName attribute, because I am reasonably sure that’s not our issue.

Are there any special files I need to add to either the OS, the JVM or the Jira installation? What I have been able to find on the internet has not worked.

Anything needed on the Database side?

SQL Server 2017 Building the connection string

SQL Server 2017 JDBC Connection properties

Hi @RobertEgan,

I think this document will help

Is there anything specific in the log file that you’re seeing?

Regards,
James.

Apologies for the delay. A few other items side tracked me. I followed the directions in the article with no luck. Here is some relative information:

Directory of D:\Atlassian\Jira\lib
02/16/2022 09:03 AM 1,327,642 mssql-jdbc-9.2.1.jre8.jar

Directory of D:\Atlassian\Jira\jre\bin
03/29/2022 04:51 PM 313,840 mssql-jdbc_auth-9.2.1.x64.dll

dbconfig.xml

<?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=****;portNumber=1433;databaseName=jiradb;integratedsecurity=true</url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <username>[LOGGED IN USER]</username>
    <password>[WINDOWS FINDS THIS]</password>
    <pool-min-size>30</pool-min-size>
    <pool-max-size>30</pool-max-size>
    <pool-max-wait>30000</pool-max-wait>
    <validation-query>select 1</validation-query>
    <min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
    <time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
    <pool-max-idle>30</pool-max-idle>
    <pool-remove-abandoned>true</pool-remove-abandoned>
    <pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
    <pool-test-on-borrow>false</pool-test-on-borrow>
    <pool-test-while-idle>true</pool-test-while-idle>
  </jdbc-datasource>
</jira-database-config>

Relevant log entries

2022-04-05 11:56:16,698+0000 JIRA-Bootstrap INFO      [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from E:\Atlassian\Jira\dbconfig.xml
2022-04-05 11:56:16,917+0000 JIRA-Bootstrap INFO      [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from E:\Atlassian\Jira\dbconfig.xml
2022-04-05 11:56:16,917+0000 JIRA-Bootstrap INFO      [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from E:\Atlassian\Jira\dbconfig.xml
2022-04-05 11:56:19,404+0000 JIRA-Bootstrap INFO      [c.a.j.c.cache.pauser.NonClusteredReplicationPauserManager] Non-clustered mode: ReplicationPauserManager implemented by NonClusteredReplicationPauserManager 
2022-04-05 11:56:19,404+0000 JIRA-Bootstrap INFO      [c.a.jira.plugin.JiraCacheResetter] [jira-cache-reseter] Created and registered for events
2022-04-05 11:56:19,419+0000 JIRA-Bootstrap INFO      [c.a.jira.plugin.PluginTransactionListener] [plugin-transaction] Created, registered for events and scheduled stats job every: 5 min
2022-04-05 11:56:19,466+0000 JIRA-Bootstrap INFO      [c.a.jira.i18n.CachingI18nFactory] [i18n-caching-factory] Created
2022-04-05 11:56:20,562+0000 JIRA-Bootstrap INFO      [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from E:\Atlassian\Jira\dbconfig.xml
2022-04-05 11:56:20,593+0000 JIRA-Bootstrap INFO      [c.a.jira.startup.JiraStartupLogger] 
2022-04-05 11:56:30,983+0000 JIRA-Bootstrap INFO      [c.a.jira.startup.JiraStartupLogger] Running Jira startup checks.
2022-04-05 11:56:30,983+0000 JIRA-Bootstrap INFO      [c.a.jira.startup.JiraStartupLogger] Jira pre-database startup checks completed successfully.
2022-04-05 11:56:31,092+0000 JIRA-Bootstrap INFO      [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is not yet configured. Enqueuing Database Checklist Launcher on post-database-configured-but-pre-database-activated queue
2022-04-05 11:56:31,092+0000 JIRA-Bootstrap INFO      [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is not yet configured. Enqueuing Post database-configuration launchers on post-database-activated queue
2022-04-05 11:56:31,124+0000 JIRA-Bootstrap INFO      [c.a.jira.startup.LauncherContextListener] Startup is complete. Jira is ready to serve.

Hi @RobertEgan,

So that looks like it’s working. It means you should now be able to go to Jira and start configuring it. It should be http://localhost:8080/ unless you’ve changed server.xml for something else.

The thing that does stick out is the URL should be

jdbc:sqlserver://<hostname>:1433;databaseName=jiradb;integratedsecurity=true

Where the servername and port should be in the format above. I think you’re using the C# format, not the JDBC format as you linked to in

Hope this helps.

James.

Not really. Because now it sends me to THIS screen: {jira-web-site}/secure/SetupDatabase!default.jspa

And that screen does not seem to be smart enough to use the Windows Authentication (at least, for the various connection strings I’ve tried). Unless you have a way to bypass this window?

Hi @RobertEgan,

From what I understand from the documentation you can enter the details and use a dummy username and password. Just make sure the jdbc URL is correct and it should be good to go.

From Use Integrated Authentication with SQL Server in Jira Server | Jira | Atlassian Documentation

Microsoft SQL Server driver will pick up domain credentials from the user that starts the Atlassian JIRA Windows service. While the actual user credentials do not need to be present in the dbconfig.xml file, the username and password tags still need to be present and populated. You may use “dummy” values in these fields.

And then it has

  • Ensure that integratedsecurity=true is present
  • You can remove domain=<mydomain> from the string as it is not used by the Microsoft Driver
  • Leave the <username> and <password> tags in as JIRA still checks for the presence of these 2 entities, and make sure they are populated with dummy values

Take note

The Atlassian JIRA Windows service will need to start as the SQL Domain User that needs to connect to the SQL Server.

Regards,
James.