aws-sdk-go-v2: ParseInt Error with role duration seconds key

Confirm by changing [ ] to [x] below to ensure that it’s a bug:

Describe the bug Unable to use configured roles due to parsing error of duration_seconds

When instiating an aws client (s3 in my case), the aws go v2 sdk is trying to parse my local roles duration_seconds (28800) and throwing a parse int error exception: error merging role duration seconds key, strconv.ParseInt: parsing "炀": invalid syntax

Checking out the SDK locally and running the tests reproduces this issue:

> cd config
> go build .
> go test .
2021/03/25 11:01:53 http: TLS handshake error from 127.0.0.1:49463: remote error: tls: bad certificate
--- FAIL: TestResolveLogger (0.00s)
    resolve_test.go:206: expect no error, got error merging role duration seconds key, strconv.ParseInt: parsing "炀": invalid syntax
FAIL
FAIL    github.com/aws/aws-sdk-go-v2/config     0.805s
FAIL
> go version
go version go1.15.2 darwin/amd64

Version of AWS SDK for Go? aws-sdk-go-v2 1.3.0

Version of Go (go version)? 1.15.2 Update: Occurs on go1.15.10 too

To Reproduce (observed behavior) Have a configured local aws profile with duration_seconds e.g:

[staging]
role_arn = arn:aws:iam::WHATEVER
mfa_serial = arn:aws:iam::WHATEVER
source_profile = aSourceProfile
duration_seconds = 28800

Run the sdk unit tests

Expected behavior No error occurs, duration_seconds correctly applied to client config

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 27 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Good find. i was able to reproduce this via unit test.

Looks like the actual root issue is that NewIntValue is trying to convert the integer to a rune which is wrong. It should first convert the integer to a string, then convert the string to a rune slice.

The value needs to be a ini.Value so it can be merged into the destination via UpdateValue

I’ll get a fixed and included in PR https://github.com/aws/aws-sdk-go-v2/pull/1568