Getting error messages SQLServerException: Invalid object name in Jira
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
問題
The following exception is logged while working with Jira in the atlassian-jira.log file.
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name "productlicense".
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:256)
環境
Microsoft SQL Server is used as database
診断
Check what is a default schema assigned to the database user used by Jira. Execute this SQL command on behalf of that user:
SELECT schema_name();
原因
Database user used by Jira has a default schema as "dbo" or some other schema, and not Jira database schema. When this happens, and the server receives SQL commands that are not fully qualified tables names, the database server does not know in which schema to look up the tables, and will error out with "Invalid object name" message.
ソリューション
Remap a correct default schema to the database user used by Jira (the schema name can be obtained via dbconfig.xml):
ALTER USER <jira_user> WITH DEFAULT_SCHEMA = jiraschema;