This issue is probably related (again) to pages migrated from on-prem to the cloud.
I’ve got a page that has a missing parent. What I mean is that the REST v2 API returns a parent ID - but there is no page with that ID.
Specifically when calling the v2 endpoint /wiki/api/v2/pages/2222222222
I get a result like this:
{
"id": "2222222222",
"parentId": "1111111111",
"parentType": "page",
"position": null,
"title": "Page Title"
}
Note the parentId
is being set to 1111111111
. Yet, retrieving a page with that ID yields a 404 response.
When calling the v1 endpoint /wiki/rest/api/content/2222222222?expand=ancestors
I get this instead:
{
"id": "2434331554",
"type": "page",
"title": "Page Title",
"ancestors": [],
"extensions": {
"position": "none"
}
}
Note the empty ancestors
array.
When opening page 2222222222
in the browser, the page tree places the page below the root page of the space (this root page has a different ID than the reported parentId
). The page also looks oddly out of place at a top-most position (judging by its real title). Also, no other pages are shown in the tree when having it open (except children of our odd page) - although there are dozens when opening a different page.
What’s going on here? Is this a known and expected phenomenon, maybe with migrated pages, if the parent page hasn’t been properly migrated?
At least this shall be a heads-up to everyone to expect this situation in Confluence Cloud.