Skip to content

Process credential resolver seems to be missing some setup #343

Open
@sichanyoo

Description

@sichanyoo

Describe the bug

Using process credential resolver by itself fails with below error:

Fatal error condition occurred in /__w/aws-sdk-swift/aws-sdk-swift/aws-sdk-swift/.build/checkouts/aws-crt-swift/aws-common-runtime/aws-c-common/source/string.c:214: allocator && aws_byte_cursor_is_valid(cursor)

The error goes away if some other credential resolver (e.g., ECS credential resolver, or profile credential resolver) is instantiated before process credential resolver is used.

There seems to be a required setup missing from process credential resolver. The bug wasn't caught till now because:

  • In default chain, process credential is 3rd resolver in the profile credential resolver chain
  • In SDK-side unit tests, Xcode executes the tests in alphabetical order. And the unit tests for ECS credential resolver always ran first before unit tests for process credential resolver. This PR: feat: ECS credentials resolver aws-sdk-swift#1945 adds SDK-side implementation of ECS credential resolver and removed CRT's ECS credential resolver instantiation from the unit tests, revealing the issue.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Using process credential resolver by itself should work without a fatal error.

Current Behavior

A fatal error gets thrown when process credential resolver is used by itself.

Reproduction Steps

Instantiate a process credential resolver using AWS Swift SDK, and call getIdentity on it. It should fail with a fatal error.

Possible Solution

Adding some sort of CRT-side required setup to the process credential resolver.

Additional Information/Context

No response

aws-crt-swift version used

0.52.1

Compiler and Version used

Xcode 16.1, Swift 5.9

Operating System and version

macOS Sequoia 15.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions