Getting error messages com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name <table name>

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Platform Notice: Data Center Only - This article only applies to Atlassian products on the data center platform.

Problem

The following exception is logged while working with Jira:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Ungültiger Objektname "AO_81F455_PERSONAL_TOKEN". at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:256)

or

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name "productlicense". at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:256)

Diagnosis

Environment

  • Microsoft SQL Server is used as database

Diagnostic Steps

  • 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();

Cause

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.

Resolution

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 you use> WITH DEFAULT_SCHEMA = jiraschema;


Last modified on Mar 29, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.