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

rain console panic against govcloud #68

Closed
slimm609 opened this issue Aug 9, 2021 · 2 comments
Closed

rain console panic against govcloud #68

slimm609 opened this issue Aug 9, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@slimm609
Copy link

slimm609 commented Aug 9, 2021

when trying to generate a rain console session, it panics when trying to generate a govcloud console session

panic: invalid character '<' looking for beginning of value [recovered]
	panic: invalid character '<' looking for beginning of value

goroutine 1 [running]:
github.com/aws-cloudformation/rain/internal/cmd.execute.func1(0xc0009ddf58)
	/__w/rain/rain/internal/cmd/wrap.go:77 +0x225
panic(0x18ce9c0, 0xc0001673e0)
	/usr/local/go/src/runtime/panic.go:965 +0x1b9
github.com/aws-cloudformation/rain/internal/cmd/console.Open(0x11fa100, 0x197f807, 0xe, 0x0, 0x0)
	/__w/rain/rain/internal/cmd/console/util.go:20 +0x345
github.com/aws-cloudformation/rain/internal/cmd/console.glob..func1(0x22f94e0, 0xc000121160, 0x0, 0x1)
	/__w/rain/rain/internal/cmd/console/console.go:27 +0x66
github.com/spf13/cobra.(*Command).execute(0x22f94e0, 0xc000121150, 0x1, 0x1, 0x22f94e0, 0xc000121150)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x22fab60, 0xc000116000, 0xc00005e748, 0x2302880)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
github.com/aws-cloudformation/rain/internal/cmd.execute(0x22fab60, 0x0)
	/__w/rain/rain/internal/cmd/wrap.go:86 +0x65
github.com/aws-cloudformation/rain/internal/cmd.Execute(0x22fab60)
	/__w/rain/rain/internal/cmd/wrap.go:95 +0x2b
main.main()
	/__w/rain/rain/cmd/rain/main.go:23 +0x2
@stilvoid stilvoid added the bug Something isn't working label Oct 7, 2021
@kaiz-io
Copy link

kaiz-io commented Jan 19, 2024

Let me know if you need me to run additional commands to test this.

Issue looks like it is in internal/aws/console/console.go and needs some logic when it is a govcloud account/region.

const signinURI = "https://signin.aws.amazon.com/federation"
...
const consoleURI = "https://console.aws.amazon.com"

needs to be

const signinURI = "https://signin.amazonaws-us-gov.com/federation"
...
const consoleURI = "https://console.amazonaws-us-gov.com"

Rain version that I tested

rain --version
Rain v1.7.5 linux/amd64

Debug output

rain --profile gov-sandbox console --region us-gov-east-1 --debug
DEBUG: Generating sign-in URL
DEBUG: GetURI cloudformation, , 
DEBUG: Loading AWS config
DEBUG: sessionName: Admin
DEBUG: Reloading AWS credentials
DEBUG: unescaped session string: {"sessionId": <removed>, "sessionKey": <removed>, "sessionToken": <removed>}
DEBUG: sessionString: <removed>
DEBUG: resp.StatusCode: 400
DEBUG: Retrying without SessionDuration after call to signin.aws.amazon.com resulted in a 400: 400 Bad Request
DEBUG: getSigninToken failed
panic: call to signin.aws.amazon.com resulted in a 400: 400 Bad Request [recovered]
	panic: call to signin.aws.amazon.com resulted in a 400: 400 Bad Request

goroutine 1 [running]:
github.com/aws-cloudformation/rain/internal/cmd.execute.func1()
	/__w/rain/rain/internal/cmd/wrap.go:77 +0x15e
panic({0x1309460?, 0xc000caf760?})
	/usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/aws-cloudformation/rain/internal/cmd/console.Open(0x0, {0x141ffb2, 0xe}, {0x0, 0x0}, {0x0, 0x0})
	/__w/rain/rain/internal/cmd/console/util.go:20 +0x2d1
github.com/aws-cloudformation/rain/internal/cmd/console.glob..func1(0xc0009c4a00?, {0xc000812b90?, 0x4?, 0x140e991?})
	/__w/rain/rain/internal/cmd/console/console.go:30 +0x55
github.com/spf13/cobra.(*Command).execute(0x2f28a00, {0xc000812b40, 0x5, 0x5})
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0xaa3
github.com/spf13/cobra.(*Command).ExecuteC(0x2f278c0)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/aws-cloudformation/rain/internal/cmd.execute(0xc000182058?)
	/__w/rain/rain/internal/cmd/wrap.go:86 +0x57
github.com/aws-cloudformation/rain/internal/cmd.Execute(0xc0000061a0?)
	/__w/rain/rain/internal/cmd/wrap.go:95 +0x13
main.main()
	/__w/rain/rain/cmd/rain/main.go:23 +0x1a

@ericzbeard
Copy link
Contributor

Working on this in #245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants