Skip to content

ExpiredTokens not refreshed for S3ClientCache / S3Link #278

@jdamick

Description

@jdamick

In using an InstanceProfile with DynamoDBMapper and an S3Link after a few hours I'm seeing:

! com.amazonaws.services.s3.model.AmazonS3Exception: The provided token has expired. (Service: Amazon S3; Status Code: 400; Error Code: ExpiredToken; Request ID: BE70A766F0ED13AE)

It appears that this is due to the S3ClientCache which upon initialization it calls s3CredentialsProvider.getCredentials() from the InstanceProfileCredentialsProvider, so after a few hours these credentials become expired. It seems that the S3ClientCache should be using the provider and calling getCredentials when it absolutely needs to so that the InstanceProfileCredentialsProvider will refresh the expired tokens.. Or perhaps I'm misunderstanding or doing something wrong?

See:

this.s3cc = new S3ClientCache(s3CredentialsProvider.getCredentials());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions