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

Using SSO (AWS Identity Center), AWS_SDK_LOAD_CONFIG=TRUE and session.NewSession() causes stack to overflow #4912

Closed
movna opened this issue Jul 17, 2023 · 1 comment · Fixed by #4917 or #4930
Assignees
Labels
bug This issue is a bug.

Comments

@movna
Copy link

movna commented Jul 17, 2023

Describe the bug

I am using SSO and when the env var AWS_SDK_LOAD_CONFIG is set to TRUE and creating a new session like below
sess, err := session.NewSession()
causes error
runtime: goroutine stack exceeds 1000000000-byte limit

Expected Behavior

No overflow of the stack. Should work fine like if the below is used

sess, err := session.NewSessionWithOptions(session.Options{
		SharedConfigState: session.SharedConfigEnable, // explicitly setting instead of env variable
	})

Current Behavior

There is an infinite loop and the program crashes eventually. Please check the stack

NewSession -> ..... -> resolveSSOCredentials -> NewSession -> ..... -> resolveSSOCredentials -> NewSession -> .....

image

Reproduction Steps

create a test go program and within the main

func main() {
	sess, err := session.NewSession()
	if err != nil { // program never reaches here
		fmt.Println(err)
	}
}

aws login sso --sso-session <name_in_config_file>
set env variable AWS_SDK_LOAD_CONFIG=TRUE
set env variable AWS_PROFILE=<some_profile_in_config_using_same_sso>
build and run the program

Possible Solution

No response

Additional Information/Context

No response

SDK version used

v1.44.300

Environment details (Version of Go (go version)? OS name and version, etc.)

go1.20.2 darwin/arm64

@movna movna added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 17, 2023
@lucix-aws lucix-aws removed the needs-triage This issue or PR still needs to be triaged. label Jul 20, 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.

aws-sdk-go-automation pushed a commit that referenced this issue Jul 28, 2023
===

### Service Client Updates
* `service/sqs`: Updates service documentation
  * Documentation changes related to SQS APIs.

### SDK Bugs
* `aws/session`: Modify resolving sso credential logic to fix stack overflow bug while configuring shared config profile via env var.
  * Fixes [4912](#4912)
aws-sdk-go-automation added a commit that referenced this issue Jul 28, 2023
Release v1.44.311 (2023-07-28)
===

### Service Client Updates
* `service/sqs`: Updates service documentation
  * Documentation changes related to SQS APIs.

### SDK Bugs
* `aws/session`: Modify resolving sso credential logic to fix stack overflow bug while configuring shared config profile via env var.
  * Fixes [4912](#4912)
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants