Page update request returns 501 on migration, making migration unusable

Hi,

When I get the migration callback on the Confluence Cloud-side, I need to do the following:

  • Iterate all migrated Cloud-pages
  • Get page content (here I also get the page version)
  • Try to find our macros on the content and if there are any, fix macros if needed.
  • If any macros were fixed, then update the page content with the fixed macro, making a new version of the page (using the retrieved page version+1 as new version number).

However, when trying to update the page content, I get this error:
Status code: 501
Message: 'com.atlassian.confluence.internal.synchrony.ExternalChangesException: Trying to access unreconciled content 15138832. Retry in a few moments’

(15138832 is the cloud-side ID of the page I tried to fix)

I have a retry-logic that tries the same PUT-operation for 5 times with exponential backoff delay, but that doesn’t help. Each operation fails with the same 501. And the same response repeats regardless of how many times I try or re-run the migration.

However, if I go to browser and visit the migrated any such page once that has macros needing a fix, then PUT-updating succeeds on that particular page, but still fails on other pages that I didn’t visit.

I assume my request must be basically correct because the PUT-content update does works after the page has been visited.

But this isn’t really feasible behaviour, we can’t really ask the customer to visit each page during the migration in order to make the page content updating succeed.

How do you suggest we resolve this? Is there something that can be done on the PUT-call that makes this work? Or some other request to make before the PUT-request?

Regards,

  • Petri

PS: This is probably the same issue as here: REST API returns 501 Not Implemented Error Until P...

Hi @PetriJuhaniRiipinen, that post you linked to has an update with

This was solved by appending “?status=current” to the URL when performing the PUT request to update the page: “/wiki/rest/api/content/PAGE_ID?status=current”

Does this help?

Hi @jrichards ,

Yes, that was the answer, now updates also work for me.

Regards,

  • Petri
1 Like