GET /wiki/api/v2/pages returns HTTP 500 when a cyclic page-ancestor chain is encountered during permission resolution

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      Issue Summary

      GET /wiki/api/v2/pages returns HTTP 500 when pagination reaches a page whose parent hierarchy contains a circular relationship.

      During permission resolution, Confluence traverses the page ancestor chain and If the hierarchy contains a cycle such as:

      Page A → Page B → Page A

      the function raises CYCLE DETECTED, which currently propagates as HTTP 500 for the entire paginated response.

      Steps to Reproduce

      1. Have a Confluence Cloud site containing a circular page-parent relationship.
      2. Call: GET /wiki/api/v2/pages
      1. Paginate through the results until a page associated with the cyclic ancestor hierarchy is reached.
      2. Observe that the request returns HTTP 500.
      3. Retry the same cursor with limit=1.
      4. The request continues to fail, confirming that the issue is associated with the specific content record rather than page size or request volume.

      Expected Results

      A malformed page hierarchy should not cause the entire paginated result to fail.

      The API should ideally:

      • Skip or safely handle the affected record.
      • Log a clear message for the error
      • Return the affected content ID
      • Detect cyclic page hierarchies earlier

      Actual Results

      A single malformed page hierarchy causes the complete /api/v2/pages request to fail with:

      {{

      { "status": 500, "code": "INTERNAL_SERVER_ERROR", "detail": null }

      }}

      This can block Marketplace apps, migration tools, backups, and other integrations that enumerate pages.

      Workaround

      Break the circular parent relationship by moving one of the affected pages to a valid parent or the space root.

              Assignee:
              Unassigned
              Reporter:
              Jagriti - (Atlassian)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: