Note

      The fix has been backported

      For more information about this and related content duplication issues, please see the discussion at Confluence Server and Data Center: Content duplication fix and next steps - Atlassian Community.

      Issue Summary

      When editing a page, the page content, or a subset of the page content is duplicated. This behaviour occurs intermittently without any special actions by the user.

      Steps to Reproduce

      This behaviour is not consistently reproducible, but may occur when a page is edited.

      Expected Results

      The editor should display only the page content.

      Actual Results

      The content appears to be duplicated in edit mode, and publishing the page results in the duplicated content being visible in view mode.

      Root Cause

      tl;dr - Confluence and Synchrony metadata intermittently falls out of sync triggering a chain of events that result in content duplication.

      When a user clicks the edit button, Synchrony will reconcile (merge) the page content held by Synchrony, with the draft content held in Confluence. This reconciled content is then sent to the web browser to be displayed in the editor, along with draft and synchrony metadata. When the editor loads, it synchronizes the new content back to Synchrony in a process called a client reconciliation to ensure everything is in sync.

      The content duplication occurs during this client reconciliation phase. From the reports provided by customers and our internal reproduction work, we identified that the Synchrony metadata being provided contained a null value in place of the expected revision data. When Synchrony performed the client reconciliation, it performed the operation with an empty source document, thus all the content in the draft from the browser appeared new. Synchrony takes this "new" content, and adds it to the existing Confluence draft. This data is then sent back to the browser, where the user will see this duplicated content.

      On the surface this may seem a nonsensical approach, but in the context of Synchrony, this approach works perfectly so long as the correct Synchrony metadata is provided. This explains how the content duplication occurs, but the root cause is earlier in the process when the page was last saved from Synchrony into the Confluence database.

      Confluence takes advantage of an event system in the Hibernate Object Relation Manager. When a page is saved from Synchrony to Confluence, an event fires that synchronizes the metadata for Confluence and Synchrony, then cleans up stale Synchrony metadata. We identified that this event was intermittently and silently failing, resulting in the old metadata being left in Confluence, and then the matching metadata in Synchrony being deleted. Thus the when Synchrony performs the first reconciliation above, it does so with metadata from Confluence that doesn't exist in Synchrony, resulting in a null version being returned, and subsequently being served to the browser.

      This issue was often automatically corrected by Confluence depending on a host of conditions that are outside of the scope of this explanation. This further obscured the root cause of the issue as it added a level of randomness to an already intermittent issue.

      Workaround

      1. In the Editor, click the Ellipsis (...) symbol
      2. Click Revert to last published version

          Form Name

            [CONFSERVER-59227] Duplicate content shown when editing a page

            Hello everybody,

            with the help of the Atlassian support team we could identify a new bug behaving somehow similarly like this closed one.

            Please have a look at Error during linked content reconciliation (triggered by an attachment) causes some linked pages content to be duplicated (CONFSERVER-99157) for more details. We faced it on a 8.5.18 LTS version, but it seems to (hopefully) occur not that frequently since several factors have to be present at the same time.

            Thanks, Rainer

            Rainer Pöhlmann added a comment - Hello everybody, with the help of the Atlassian support team we could identify a new bug behaving somehow similarly like this closed one. Please have a look at Error during linked content reconciliation (triggered by an attachment) causes some linked pages content to be duplicated ( CONFSERVER-99157 ) for more details. We faced it on a 8.5.18 LTS version, but it seems to (hopefully) occur not that frequently since several factors have to be present at the same time. Thanks, Rainer

            Hello,

            we saw this bug again in Version 8.5.17 Datacenter.

            So this bug apparently still exist.

            Stefan.mattetat added a comment - Hello, we saw this bug again in Version 8.5.17 Datacenter. So this bug apparently still exist.

            I just noticed this problem again in version 9.1.1.

            Martin Hofmann added a comment - I just noticed this problem again in version 9.1.1.

            Seeing this a 8.5.14 instance as well.
            Please Reopen.

            Simon Tost [TNG] added a comment - Seeing this a 8.5.14 instance as well. Please Reopen.

            This issue is till pressent in 8.5.11. The page effected was a month ago published, but after the last edit the issues occurred.
            We installed 7.15 in march of 2022 and 8.5.3 november last year.

            Thimo Mulder added a comment - This issue is till pressent in 8.5.11. The page effected was a month ago published, but after the last edit the issues occurred. We installed 7.15 in march of 2022 and 8.5.3 november last year.

            Hi, this issue is not fixed or reappeared. I got it several times on 8.5.4, 

            Christian Binard added a comment - Hi, this issue is not fixed or reappeared. I got it several times on 8.5.4, 

            Hi,

            I am Also facing this issue when trying to edit duplicate content is adding everytime. currently i have upgraded confluence from 7.19.11 to 7.19.14 version. which shows not affected.

            Rahul Kumar added a comment - Hi, I am Also facing this issue when trying to edit duplicate content is adding everytime. currently i have upgraded confluence from 7.19.11 to 7.19.14 version. which shows not affected.

            Hi All,

            I am facing this error
            My problem has nothing to do with the draft
            When a page has been created and I want to update it, and I click the updaate option, then I face the duplicate of the content of the page.
            I hope this problem can be solved
            (Confluence version 7.4.6)

            reyhanehsepehri added a comment - Hi All, I am facing this error My problem has nothing to do with the draft When a page has been created and I want to update it, and I click the updaate option, then I face the duplicate of the content of the page. I hope this problem can be solved (Confluence version 7.4.6)

            See CONFCLOUD-75450 Duplicate content shown when editing a page - Create and track feature requests for Atlassian products.

            Gerben Heinen added a comment - See CONFCLOUD-75450 Duplicate content shown when editing a page - Create and track feature requests for Atlassian products.

            Similar to us, after a fix in Confluence Server it didn't happen as much as it did anymore, but after migration to the cloud it is back.

            Gerben Heinen added a comment - Similar to us, after a fix in Confluence Server it didn't happen as much as it did anymore, but after migration to the cloud it is back.

              mfedoryshyn Maksym Fedoryshyh
              lfaganello@atlassian.com Leonardo Faganello (Inactive)
              Affected customers:
              161 This affects my team
              Watchers:
              311 Start watching this issue

                Created:
                Updated:
                Resolved: