Synchrony can't be enabled, throw an ERROR: relation \"SECRETS\" does not exist
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Problem
When trying to edit a page after enabling Collaborative Editing, it fails. The atlassian-confluence.log file has the below errors:
Caused by: org.postgresql.util.PSQLException: ERROR: relation \"SECRETS\" does not exist
INFO [ListenableFutureAdapter-thread-3] [plugins.synchrony.config.DefaultSynchronyConfigurationManager] postConfigToSynchrony [Collab editing plugin] Synchrony response (500): Could not verify AppID/Secret for real-time collaboration service at endpoint: http://127.0.0.1:8091/synchrony/v1/apps/secret
Cause
Synchrony tables related tables i.e., EVENTS, SNAPSHOTS, and SECRETS are in lowercase.
Resolution
Please ensure that you take the necessary Database and Confluence Instance backups prior to running the steps below. Note that the below query is applicable for Postgres. If needed, work with your DBA to amend the queries according to the Database in use.
- Take a backup of your Postgres DB
- Switch Collaborative Editing to OFF.
- Shutdown Confluence Instance (all nodes if using Data Center)
- Alter the three tables to have UPPERCASE names:
ALTER TABLE public."snapshots" RENAME TO "SNAPSHOTS";
ALTER TABLE public."events" RENAME TO "EVENTS";
ALTER TABLE public."secrets" RENAME TO "SECRETS";
- Cleanup the table entries by running the below query
TRUNCATE TABLE "EVENTS";
TRUNCATE TABLE "SECRETS";
TRUNCATE TABLE "SNAPSHOTS";
- Cleanup bandana to start to register the Synchrony service:
delete from bandana where bandanakey = 'synchrony_collaborative_editor_app_registered'
or bandanakey = 'synchrony_collaborative_editor_app_secret'
or bandanakey = 'synchrony_collaborative_editor_app_id';
- Start Confluence and switch Collaborative Editing to ON again.