awslabs / aws-sdk-swift

Apache License 2.0
400 stars 79 forks source link

AWSClientRuntime.AWSCredentialsProvider.fromChain() blocks an ECS/Fargate task #506

Closed tachyonics closed 2 years ago

tachyonics commented 2 years ago

Description

Calling AWSClientRuntime.AWSCredentialsProvider.fromChain() to obtain a credentialsProvider before trying to instantiate any clients causes (in my case) the ECS task to block and doesn't proceed any further. Letting each client get its own credentials provider (which from the code looks like it uses the same command) works as expected.

Context

Running into this issue stops the ECS task from proceeding, causing it to not be able to accept any traffic and eventually fail health checks. A work around is to let the clients create their own credentials provider but this will prevent more advanced use cases.

Environment

Reproduction Steps

  1. Create an application that simply tries to create a credentials provider.
  2. Build and deploy to ECS/Fargate

Observed Behavior

The application calls into AWSClientRuntime.AWSCredentialsProvider.fromChain() but doesn't return and continue execution.

Expected Behavior

The application completes initialisation.

Possible Solution

kneekey23 commented 2 years ago

hi @tachyonics thanks for reporting this issue! we will investigate as soon as we can

wooj2 commented 2 years ago

@tachyonics - I suspect one of the credential providers is hanging and not completing.

  1. Which credential provider are you attempting to use from the default chain? I suspect one of the credential providers is not returning for some reason.
  2. Can you provide a hello world code sample that we can execute in an AL2 instance?