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

Panic on assume profile #63

Closed
J00MZ opened this issue Feb 27, 2022 · 2 comments
Closed

Panic on assume profile #63

J00MZ opened this issue Feb 27, 2022 · 2 comments

Comments

@J00MZ
Copy link
Contributor

J00MZ commented Feb 27, 2022

On MacOS Monterey 12.2.1

Trying to get setup and running, getting this runtime error

❯ assume -c <MY_PROFILE_NAME>

If browser is not opened automatically, please open link:
https://device.sso.<REGION>/?user_code=<CODE>

Awaiting authentication in the browser...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102716644]

goroutine 1 [running]:
github.com/99designs/keyring.(*fileKeyring).unlock(0x14000523f50)
	/Users/runner/go/pkg/mod/github.com/99designs/keyring@v1.2.0/file.go:70 +0xa4
github.com/99designs/keyring.(*fileKeyring).Set(0x14000523f50, {{0x14000138510, 0x24}, {0x140000d3080, 0x522, 0x580}, {0x0, 0x0}, {0x0, 0x0}, ...})
	/Users/runner/go/pkg/mod/github.com/99designs/keyring@v1.2.0/file.go:139 +0x98
github.com/common-fate/granted/pkg/credstore.Store({0x14000138510, 0x24}, {0x102a35200, 0x14000523c20})
	/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/credstore/credstore.go:35 +0xdc
github.com/common-fate/granted/pkg/cfaws.StoreSSOToken({0x14000138510, 0x24}, {{0x140002aa000, 0x4e4}, {0xc07f0821e6770008, 0x1a335582abcd, 0x102edb240}})
	/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/cfaws/secure_token_storage.go:32 +0x64
github.com/common-fate/granted/pkg/cfaws.(*CFSharedConfig).SSOLogin(0x140001741e0, {0x102accc70, 0x140001aa010})
	/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/cfaws/sso.go:61 +0x1ac
github.com/common-fate/granted/pkg/cfaws.(*CFSharedConfig).Assume(0x140001741e0, {0x102accc70, 0x140001aa010})
	/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/cfaws/profiles.go:190 +0x1d8
github.com/common-fate/granted/pkg/assume.AssumeCommand(0x140001a9ac0)
	/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/assume/assume.go:88 +0x610
github.com/common-fate/granted/pkg/updates.WithUpdateCheck.func1(0x140001a9ac0)
	/Users/runner/work/granted-cli-build/granted-cli-build/granted/pkg/updates/updates.go:69 +0xc8
github.com/urfave/cli/v2.(*App).RunContext(0x140002b6820, {0x102accc70, 0x140001aa010}, {0x14000192180, 0x3, 0x3})
	/Users/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 +0x6e8
github.com/urfave/cli/v2.(*App).Run(...)
	/Users/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
main.main()
	/Users/runner/work/granted-cli-build/granted-cli-build/granted/cmd/assume/main.go:13 +0x60

Couple of things in my setup I could think of:

  1. I was using ssocreds
  2. Was logged in and connected in browser
  3. Was trying to switch default browser from Brave to Firefox, and despite changing and restarting Terminal (iterm2) did not change and start Firefox rather still opens Brave, although output of granted browser command still shows Firefox...
❯ granted browser
Granted is using FIREFOX. To change this run `granted browser set`.

Things I tried but issue still persists

  1. aws sso logout
@JoshuaWilkes
Copy link
Contributor

Hi @J00MZ

Thanks for submitting this issue, could you please let me know which version of granted you are running granted -v

We had an issue here #54 which looks to be the same panic error and has been resolved in the latest release v0.1.5

If you are running a version older than v0.1.5 you should first run rm ~/.granted/cred-store which will remove the old cred-store file which was made in error. Followed by brew install granted to up upgrade to the latest version.

After this, you can try to assume a profile with granted and you should not get the panic error.

Let us know how this goes, then we can work through the issue with your browsers.
Thanks!

@J00MZ
Copy link
Contributor Author

J00MZ commented Feb 28, 2022

Hi @JoshuaWilkes
Yep seems that was the case 😄

❯ granted -v
.
.
Version: 0.1.3

Upgraded as you described

❯ granted -v
.
.
Version: 0.1.5

And looking good now!

❯ assume -c <MY_PROFILE>
If browser is not opened automatically, please open link:
https://device.sso.<REGION>/?user_code=<CODE>

Awaiting authentication in the browser...
? Enter passphrase to unlock "/Users/<USERNAME>/.granted/cred-store"

ℹ️ use -s to open a specific service (https://docs.commonfate.io/granted/usage/console)

Opening a console for <MY_PROFILE> in your browser...

It does still open the initial authentication via Brave but the actual tabs open in Firefox, thanks guys!

@J00MZ J00MZ closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants