Confluence Data Center fails to start after upgrading to version 8.X

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

After upgrading to Confluence Data center 8.X, users experienced startup issues, particularly during the schema upgrade process.

Environment

Confluence Data Center 8.X.

Diagnosis

The Confluence user interface presents the following error page.

(Auto-migrated image: description temporarily unavailable)

The application logs contain the following entries related to this error:

Traces in the logs

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ERROR [Catalina-utility-1] [atlassian.confluence.plugin.PluginFrameworkContextListener] launchUpgrades Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.DenormalisedPermissionsTriggersUpgradeTask@5350f13a failed during the SCHEMA_UPGRADE phase due to: StatementCallback; bad SQL grammar [DROP FUNCTION IF EXISTS space_permission_function_for_denormalised_permissions();]; nested exception is org.postgresql.util.PSQLException: ERROR: must be owner of function space_permission_function_for_denormalised_permissions com.atlassian.confluence.upgrade.UpgradeException: Upgrade task com.atlassian.confluence.upgrade.upgradetask.DenormalisedPermissionsTriggersUpgradeTask@5350f13a failed during the SCHEMA_UPGRADE phase due to: StatementCallback; bad SQL grammar [DROP FUNCTION IF EXISTS space_permission_function_for_denormalised_permissions();]; nested exception is org.postgresql.util.PSQLException: ERROR: must be owner of function space_permission_function_for_denormalised_permissions at com.atlassian.confluence.upgrade.AbstractUpgradeManager.executeUpgradeStep(AbstractUpgradeManager.java:305) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:261) at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:178) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.launchUpgrades(PluginFrameworkContextListener.java:122) at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:82) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4005) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4448) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [DROP FUNCTION IF EXISTS space_permission_function_for_denormalised_permissions();]; nested exception is org.postgresql.util.PSQLException: ERROR: must be owner of function space_permission_function_for_denormalised_permissions at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)

Cause

The Confluence upgrade process encountered a failure due to the default functions being owned by the root user rather than the designated Confluence database user. This issue can be confirmed by executing the following query.

⚠️ The following query has been tested with a PostgreSQL database.

PostgreSQL

1 2 3 4 SELECT proname, proowner::regrole FROM pg_proc WHERE pronamespace::regnamespace::text = 'public';

Sample output of the problematic configuration is shown below:

1 2 3 4 5 6 7 8 proname | proowner ----------------------------------------------------------+---------- content_function_for_denormalised_permissions | root content_perm_set_function_for_denormalised_permissions | root content_permission_function_for_denormalised_permissions | root space_function_for_denormalised_permissions | root space_permission_function_for_denormalised_permissions | root (5 rows)
  • In this context, the proowner is configured to the root user rather than the Confluence user. You can verify the database username by checking the hibernate.connection.username field in the confluence.cfg.xml file.

For MySQL

MySQL

1 2 3 4 SELECT ROUTINE_NAME, DEFINER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = 'my_database';

⚠️ Please replace 'my_database' with your actual database name.

Solution

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

To resolve this issue, please follow these steps:

  1. Request the DBA to transfer the ownership of these functions to the Confluence DB user.

  2. The correct configuration sample for the database username is confluence.

    1 2 3 4 5 6 7 8 proname | proowner ----------------------------------------------------------+---------- content_function_for_denormalised_permissions | confluence content_perm_set_function_for_denormalised_permissions | confluence content_permission_function_for_denormalised_permissions | confluence space_function_for_denormalised_permissions | confluence space_permission_function_for_denormalised_permissions | confluence (5 rows)
  3. You should now be able to start the Confluence instance.

In case of further assistance please reach out to the Atlassian Support team and share the information that's been gathered so far along with a fresh Support zip file.

Updated on May 5, 2025

Still need help?

The Atlassian Community is here for you.