Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging max_attempts or duration_seconds configs across files with invalid values will silently default to 0 #2287

Closed
lucix-aws opened this issue Sep 20, 2023 · 1 comment · Fixed by #2286
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue

Comments

@lucix-aws
Copy link
Contributor

Describe the bug

This is going to be addressed by #2286 but I'm creating it for visibility.

If you specify multiple config files when loading shared config, "numeric" keys will silently default to 0 if a profile merge occurs from a source where one of those values are not a valid number.

At this time this only affects two fields:

  • max_attempts
  • duration_seconds

Expected Behavior

Shared config recognizes the invalid value and returns an error.

Current Behavior

Silently defaults to the zero value.

Reproduction Steps

Create two config files:

[default]
max_attempts=54
[default]
region=us-east-2
max_attempts=invalid
func main() {
    cfg, err := config.LoadDefaultConfig(context.Background(), func(o *config.LoadOptions) error {
        o.SharedConfigFiles = []string{
            "/Users/lucix/.aws/config",
            "/Users/lucix/.aws/config2",
        }
        return nil
    })
    if err != nil {
        log.Fatal(err)
    }

    dynamodb.NewFromConfig(cfg, func(o *dynamodb.Options) {
        fmt.Println(o.Region)
        fmt.Println(o.RetryMaxAttempts)
    })
}

This will output

us-east-2
0

We should see an error when attempting to load the value for RetryMaxAttempts.

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

latest

Compiler and Version used

latest

Operating System and version

n/a

@lucix-aws lucix-aws added bug This issue is a bug. p3 This is a minor priority issue labels Sep 20, 2023
@lucix-aws lucix-aws self-assigned this Sep 20, 2023
lucix-aws added a commit that referenced this issue Sep 20, 2023
lucix-aws added a commit that referenced this issue Sep 21, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant