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

Can't set user logins on existent account #15083

Closed
lfdominguez opened this issue Aug 1, 2022 · 1 comment · Fixed by #14552
Closed

Can't set user logins on existent account #15083

lfdominguez opened this issue Aug 1, 2022 · 1 comment · Fixed by #14552
Labels
bug cli Tickets related to CLI experience good-starter-issue Good starter issue to start contributing to Teleport tctl tctl - Teleport admin tool

Comments

@lfdominguez
Copy link

Expected behavior:
Add the missing login to existent user with the command tctl users update --set-logins=login user

Current behavior:
Crash:

panic: assignment to entry in nil map

goroutine 1 [running, locked to thread]:
github.com/gravitational/teleport/tool/tctl/common.(*UserCommand).Update(0xc000c96140, {0x37f2a60, 0xc000c7b080}, {0x381f2e8, 0xc000c834c0})
	/go/src/github.com/gravitational/teleport/tool/tctl/common/user_command.go:309 +0x333
github.com/gravitational/teleport/tool/tctl/common.(*UserCommand).TryRun(0xc000c96140, {0x37f2a60, 0xc000c7b080}, {0xc00097ab60, 0xc}, {0x381f2e8, 0xc000c834c0})
	/go/src/github.com/gravitational/teleport/tool/tctl/common/user_command.go:123 +0x1b7
github.com/gravitational/teleport/tool/tctl/common.Run({0xc000d1fe60, 0x11, 0x41f525?})
	/go/src/github.com/gravitational/teleport/tool/tctl/common/tctl.go:186 +0x113d
main.main()
	/go/src/github.com/gravitational/teleport/tool/tctl/main.go:46 +0x36a

Bug details:

  • Teleport version: Teleport v10.0.2 git:v10.1.0-dev.ryan.1-0-g9c2b63781 go1.18.3

  • Recreation steps:

    1. Create a user without principals (logins)
    2. Try to add login to the created account with command tctl users update --set-logins=login user
  • Debug logs

panic: assignment to entry in nil map

goroutine 1 [running, locked to thread]:
github.com/gravitational/teleport/tool/tctl/common.(*UserCommand).Update(0xc000c96140, {0x37f2a60, 0xc000c7b080}, {0x381f2e8, 0xc000c834c0})
	/go/src/github.com/gravitational/teleport/tool/tctl/common/user_command.go:309 +0x333
github.com/gravitational/teleport/tool/tctl/common.(*UserCommand).TryRun(0xc000c96140, {0x37f2a60, 0xc000c7b080}, {0xc00097ab60, 0xc}, {0x381f2e8, 0xc000c834c0})
	/go/src/github.com/gravitational/teleport/tool/tctl/common/user_command.go:123 +0x1b7
github.com/gravitational/teleport/tool/tctl/common.Run({0xc000d1fe60, 0x11, 0x41f525?})
	/go/src/github.com/gravitational/teleport/tool/tctl/common/tctl.go:186 +0x113d
main.main()
	/go/src/github.com/gravitational/teleport/tool/tctl/main.go:46 +0x36a
@lfdominguez lfdominguez added the bug label Aug 1, 2022
@zmb3 zmb3 added tctl tctl - Teleport admin tool cli Tickets related to CLI experience good-starter-issue Good starter issue to start contributing to Teleport labels Aug 1, 2022
@strideynet
Copy link
Contributor

strideynet commented Aug 1, 2022

It appears #14552 makes use of the new SetRoles method on the User type, which accounts for situations where there are no existing traits. So when that's merged down, this bug will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli Tickets related to CLI experience good-starter-issue Good starter issue to start contributing to Teleport tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants