Incorrect MS SQL Schema Used
Symptoms
- Certain JIRA functions may fail with SQL Exceptions.
- JIRA may fail to run altogether.
The following appears in the atlassian-jira.log
:
___ Database Configuration ________________
Loading entityengine.xml from : file:/C:/Data/Jira/atlassian-jira/WEB-INF/classes/entityengine.xml
Entity model field type name : mssql
Entity model schema name :
Database Version : Microsoft SQL Server - 10.50.2500
Database Driver : jTDS Type 4 JDBC Driver for MS SQL Server and Sybase - 1.2.4
Database URL : jdbc:jtds:sqlserver://sqlserver:1433/jiradb
Database JDBC config : mssql jdbc:jtds:sqlserver://sqlserver:1433/jiradb
Cause
This is either caused by an incorrect configuration when JIRA is installed or this bug as tracked under JRASERVER-25329 - JIRA 4.4 MSSQL schema in dbconfig.xml does not get picked up by ./config.sh. In this case all tables will be stored on the root schema (dbo
), and occasionally other applications will store tables under this schema. Having a schema specifically for JIRA can prevent something like this from occurring and we recommend fixing this immediately. Additionally, this can cause some failures with Active Objects, (e.g.: plugins such as GreenHopper, Tempo, Activity Streams).
If the schema is missing altogether, it is absolutely critical that it is specified otherwise it will cause significant problems with the JIRA instance.
Resolution
Stop JIRA and point it to use the
dbo
schema.- Start JIRA and back it up using the XML export functionality as in Backing Up Data.
- Create the required schema, as in the below documentation, ensuring it has the correct permissions:
- Stop JIRA.
- Using the JIRA Configuration Tool update JIRA to refer to the new schema (this should be
jiraschema
). - Start JIRA.
- Restore the XML backup from step 2.
This can also be done with the steps within Change the schema name for Jira database tables.