GET templates with body returns 504 timeout for tenants with many templates

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      Issue Summary

      The REST API endpoint `GET /rest/api/template/page?expand=body.storage` times out with a 504 Gateway Timeout for tenants with a large number of page templates (~50+). The limit and start pagination parameters have no effect on reducing response time.

      Steps to Reproduce

      1. Have a Confluence Cloud site with 50+ page templates (space-level)
      2. Call GET /wiki/rest/api/template/page?spaceKey=<KEY>&expand=body.storage&limit=15
      3. Observe 504 Gateway Timeout with response header X-Failure-Category: FAILURE_ORIGIN_READ_TIMEOUT

      Expected Results

      The API should at the least reliably process requests within its documented pagination limits, including the default limit of 25.

      An API consumer cannot reasonably be expected to know the size or complexity of the templates before retrieving them. Therefore, they should be able to use the documented/default pagination parameters without having to predict which templates might cause an internal processing timeout.

      Actual Results

      The endpoint can time out with a 504 Gateway Timeout even when a significantly smaller number of templates is requested (example, limit=15).

      Workaround

      As a temporary workaround:

      • Retrieve the template metadata first, without expanding body.storage.
      • Retrieve the body of each template individually using:
        GET /rest/api/template/{id}?expand=body.storage

      OR

      • Use even lesser limits like 10 for the API

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

                Created:
                Updated: