Asset uploads return 503 and folder requests return 404 in AEM Assets

This article explains how to resolve service degradation in Adobe Experience Manager as a Cloud Service that results in HTTP 503 and 404 errors during asset uploads and folder operations, typically caused by a rapidly growing ingestion queue and high concurrent requests.

Description description

Environment

  • Adobe Experience Manager Assets as a Cloud Service
  • AEM Author environment
  • Programmatic asset ingestion
  • Direct Binary Upload

Issue/Symptoms

  • You receive an HTTP 503 response when uploading assets to AEM.
  • You receive an HTTP 404 response when querying a newly created folder.
  • You see folder creation accepted, but the folder isn’t immediately available to subsequent requests.
  • You see the ingestion queue grow rapidly and requests time out or remain unprocessed.
  • You can’t retrieve recently ingested assets.
  • You see assets remain in the Processing state for an extended period.
  • You see folder-creation and upload requests become slower while the backlog continues to grow.

Cause

A high rate of concurrent asset-ingestion and folder-creation requests creates a processing backlog in the AEM Author environment. The workload generates commit conflicts, increases queue depth and CPU use, and delays folder and asset availability. As the backlog grows, upload requests return HTTP 503, folder lookups return HTTP 404, and asset processing takes longer to complete.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Monitor the ingestion queue:

    • Use the available AEM monitoring tools or relevant APIs to track the number of queued events.
    • Check whether the queue continues to grow or begins to decrease.
  2. Reduce the ingestion rate:

    • Lower the asset-upload rate to fewer than 9,000 assets per hour, or approximately 150 assets per minute, to avoid overwhelming the processing queue.
    • Temporarily pause ingestion if the backlog continues to grow.
  3. Optimize the folder-creation logic:

    • Create folders one level at a time instead of creating a nested path in one request.
    • After creating a folder, confirm that it exists before uploading assets to it.
  4. Implement retries with exponential backoff:

    • Retry failed folder-creation and asset-upload requests that return errors such as HTTP 404 or HTTP 503.
    • Use exponential backoff by waiting approximately 1, 2, 4, and 8 seconds between retries, for a maximum of five attempts.
    • Avoid running parallel retries against the same folder.
  5. Ensure that the affinity cookie is used:

    • Send the affinity cookie returned by the folder-creation response with every subsequent request for that folder, including folder lookup, initiateUpload, and completeUpload, to keep the requests on the same pod.
  6. Verify the result:

    • Monitor the ingestion queue and asset-processing status after applying the changes.
    • Confirm that the queue returns to its typical level.
    • Confirm that assets and folders are processed without HTTP 503 or HTTP 404 responses.
recommendation-more-help
experience-cloud-kcs-help-kbarticles