Got 403 response when query page during migration in cloud site

I’m developing a simple Confluence server to cloud migration. It collects page ids from server side and send them to cloud. In the cloud side it query page by those page ids and update some macro definitions. However there is always 403 error when cloud side migration trying to get a page by id using /rest/api/content/${pageId}?expand=body.storage,version API.

My setup:

  • create a space with a few pages. The space is not public for anonymous users
  • select my app and that space when trigger migration from server side
  • I’m using a free plan cloud site
    => Got 403 error when cloud side trying to query pages by id:
{
   "statusCode":403,
   "data":{
      "authorized":false,
      "valid":false,
      "errors":[
         {
            "message":{
               "key":"confluence.space.restricted",
               "translation":"Space is restricted",
               "args":[]
            }
         }
      ],
      "successful":false
   },
   "message":"com.atlassian.confluence.api.service.exceptions.PermissionException: Space is restricted"
}

But the 403 error does not happen when either:

  • migrate space only first, wait for it complete and then trigger migrate for the app OR
  • make the space public for anonymous user

Is it the expected behavior that mean spaces need to migrate first? Or it is the limitation when using free cloud site?

Hi
I guess you are affected by this [MIG-837] Apps can't access restricted content in Confluence Cloud - Create and track feature requests for Atlassian products.
(same as we are)
Alex

2 Likes

Hi @sash011,

Thank you for pointing out the bug.

What I don’t understand is why migrate the spaces first then the app later works? What is the difference?

Hi @NhanNguyen,

I’d say it’s more likely

that’s the error based on the message. They have similar symptoms. The reason it may work later is perhaps a different migration adds the app user to the default group correctly, uninstall re-installing the app adds the permissions, or something else. I find in development sometimes the constant repeated migrations will be slightly different and so determining the reason between one working and one failing can be tricky.

We’re working on a solution for MIG-905. Please watch it for updates.

Regards,
James.

1 Like