Cannot create or edit pages with collaborative editing enabled

Still need help?

The Atlassian Community is here for you.

Ask the community

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

This problem could also present in Server instances.

Problem

Collaborative editing does allow new pages to be created or pages to be edited. Synchrony seems to start up fine. The system logs an error about an invalid JWT key, and complains about being unable to find the content that the user is trying to edit.

The following appears in the atlassian-confluence.log file:

2019-02-14 22:16:43,860 WARN [http-nio-8090-exec-5] [synchrony.service.http.SynchronyResponseHandler] failed Synchrony external changes API call returned 401: {"type":"jwt/invalid-aud","message":"Error validating JWT"} content-id: 8540519 rev: null ancestor: null merges: {"confVersion":"53","trigger":null,"type":"external"} generate-rev: true generate-reset: true

The following appears in the atlassian-synchrony.log file:

2019-02-14 22:16:43,860 WARN [http-nio-8090-exec-5] [synchrony.service.http.SynchronyResponseHandler] failed Synchrony external changes API call returned 401: {"type":"jwt\/invalid-aud","message":"Error validating JWT"} content-id: 8540519 rev: null ancestor: null merges: {"confVersion":"53","trigger":null,"type":"external"} generate-rev: true generate-reset: true
 -- space: 9306114 | url: /plugins/editor-loader/editor.action | page: 8540519 | traceId: 81e2b1c97ab9d93d | userName: User123 | referer: https://confluence-base-url/display/TEST/Redacted+page+title | action: editor

Cause

There is a mismatched appsecret between Confluence and Synchrony. The appsecret is a secret that is shared between Synchrony and Confluence upon initial registration, when Confluence starts for the first time. Somehow, due to an as-of-yet unknown reason, this entry becomes corrupted or mismatched.

Even though the Synchrony logs mention the JWT key, that does not actually come into play. The JWT key is only used when Synchrony encryption is enabled, and so any calls to retrieve it will return "dummy-key-value". As long as Synchrony encryption is not enabled (which is the default state), the JWT key is not used in Synchrony/Confluence communication.

Resolution

Reset the appsecret. To do that, shut down your Confluence instance and execute the following SQL commands:

DELETE FROM bandana WHERE bandanakey = 'synchrony_collaborative_editor_app_registered'
         OR bandanakey = 'synchrony_collaborative_editor_app_secret'
         OR bandanakey = 'synchrony_collaborative_editor_app_id';
TRUNCATE TABLE "EVENTS";
TRUNCATE TABLE "SECRETS";
TRUNCATE TABLE "SNAPSHOTS";

The TRUNCATE commands will remove all the Synchrony data (including the draft information). This step is required. Removing the registration will mean that the existing Synchrony edit history is lost anyway, so truncating the Synchrony tables will clean up the irretrievable data. The actual pages and drafts are stored permanently in Confluence and are not affected.

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


DescriptionCollaborative editing does allow new pages to be created or pages to be edited. The system logs an error about an invalid JWT key.
ProductConfluence

Last modified on Mar 21, 2024

Was this helpful?

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