Confluence throws an 'Invalid object name BANDANA' error

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

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.

*Except Fisheye and Crucible

Summary

Problem

Confluence does not start. The database may have been cloned for use in a test/staging environment.

The following appears in atlassian-confluence.log:

1 2 3 4 5 2015-01-13 11:10:32,717 ERROR [main] [atlassian.confluence.plugin.PluginFrameworkContextListener] contextInitialized Error initialising plugin manager: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is java.sql.SQLException: Invalid object name 'BANDANA'. org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: Could not execute query; bad SQL grammar []; nested exception is java.sql.SQLException: Invalid object name 'BANDANA'. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:364)

Diagnosis

Environment

  • Confluence is running against an MS SQL Server database.

Cause

The database user that is used to connect to the Confluence application is not mapped to the correct schema.

Solution

Resolution

  1. Log in to SQL Server Management Studio with an administrator account.

  2. Navigate to Confluence's Database > Security > Users in the drop down navigation.

  3. Select the database user used in Confluence.

  4. Right-click and go to Properties > General

  5. Change the default schema for the user, via queries such as this:

    1 ALTER USER <USER> WITH DEFAULT_SCHEMA = <SCHEMANAME>;

    Replace <USER> with the SQL Server user's username (the one Confluence is connecting as), and <SCHEMANAME> with the name of the schema where Confluence tables are stored in

    In most cases, switching the tables back to the default 'dbo' schema is preferred. If setting the default schema to 'dbo' doesn't work, please contact Support.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.