Skip to content

bug: AwsConfigInfrastructureProvider: Missing error handling for InvalidNextTokenException causes permanent ingestion failure #586

@Chris-Lee-Ca

Description

@Chris-Lee-Ca

📜 Description

The next() method in AwsConfigInfrastructureProvider does not handle InvalidNextTokenException from the AWS Config API. When paginating large resource sets via the Backstage incremental ingestion engine, the NextToken returned by AWS Config can expire between ingestion bursts. Since next() function has no try/catch for this exception, the error propagates unhandled to the incremental ingestion engine, which enters an infinite backoff-retry loop using the same stale cursor — resulting in a permanent ingestion failure that cannot self-recover.

👍 Expected behavior

When the AWS Config API returns InvalidNextTokenException, the provider should catch the error and restart pagination from the beginning. The ingestion should recover gracefully and complete successfully.

👎 Actual Behavior with Screenshots

Image

👟 Reproduction steps

  1. Configure @aws/aws-config-catalog-module-for-backstage with a multi-account AWS Config aggregator containing a large number of resources (enough to require multiple pages / multiple ingestion bursts to complete)
  2. Wait for the NextToken to expire between bursts
  3. On the next burst, AWS Config API returns InvalidNextTokenException

📃 Content

No response

🖥️ Your Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions