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

🧹 fix panic during login with wrong token #1963

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Conversation

chris-rock
Copy link
Member

This change fixes a panic during login when the token is invalid. It also changes the fatal logging to pure warn with os exit.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x104c16f70]

goroutine 1 [running]:
go.mondoo.com/ranger-rpc.(*Client).DoClientRequest(0x140002e8b80, {0x1056222a0?, 0x105fdeae0}, {0x10560f8f8, 0x14000732ff0}, {0x14000734220, 0x1e}, {0x105610598, 0x14000733230}, {0x1056105b8, ...})
	/Users/chris/go/pkg/mod/go.mondoo.com/[email protected]/client.go:65 +0x2a0
go.mondoo.com/cnquery/providers-sdk/v1/upstream.(*AgentManagerClient).PingPong(0x140002e8b80, {0x1056222a0, 0x105fdeae0}, 0x14000732ff0?)
	/Users/chris/go/src/go.mondoo.com/cnquery/providers-sdk/v1/upstream/upstream.ranger.go:65 +0xc0
go.mondoo.com/cnquery/apps/cnquery/cmd.register({0x0, 0x0})
	/Users/chris/go/src/go.mondoo.com/cnquery/apps/cnquery/cmd/login.go:230 +0xfcc
go.mondoo.com/cnquery/apps/cnquery/cmd.glob..func6(0x140006d4300?, {0x1050ce013?, 0x4?, 0x1050cdfaf?})
	/Users/chris/go/src/go.mondoo.com/cnquery/apps/cnquery/cmd/login.go:49 +0x74
github.com/spf13/cobra.(*Command).execute(0x105ebaac0, {0x140004aecc0, 0x2, 0x2})
	/Users/chris/go/pkg/mod/github.com/spf13/[email protected]/command.go:944 +0x640
github.com/spf13/cobra.(*Command).ExecuteC(0x105ebbc00)
	/Users/chris/go/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x320
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/chris/go/pkg/mod/github.com/spf13/[email protected]/command.go:992
go.mondoo.com/cnquery/apps/cnquery/cmd.Execute()
	/Users/chris/go/src/go.mondoo.com/cnquery/apps/cnquery/cmd/root.go:71 +0x15c
main.main()
	/Users/chris/go/src/go.mondoo.com/cnquery/apps/cnquery/cnquery.go:9 +0x1c

@vjeffrey
Copy link
Contributor

works great for me!

@vjeffrey vjeffrey merged commit 458356d into main Sep 27, 2023
10 checks passed
@vjeffrey vjeffrey deleted the chris-rock/login branch September 27, 2023 22:06
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants