Skip to content

Instantly share code, notes, and snippets.

@klizhentas
Created February 12, 2021 19:18
Show Gist options
  • Save klizhentas/eb0500257c74943a7ac5df17b67539a9 to your computer and use it in GitHub Desktop.
Save klizhentas/eb0500257c74943a7ac5df17b67539a9 to your computer and use it in GitHub Desktop.
MFA Migration failed
ERROR REPORT:
Original Error: *trace.BadParameterError MFA device named "otp" already exists
Stack Trace:
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/authentication.go:48 github.com/gravitational/teleport/lib/services.ValidateLocalAuthSecrets
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/resource.go:485 github.com/gravitational/teleport/lib/services/local.itemToLocalAuthSecrets
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/resource.go:432 github.com/gravitational/teleport/lib/services/local.userFromUserItems
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/users.go:101 github.com/gravitational/teleport/lib/services/local.(*IdentityService).getUsersWithSecrets
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/users.go:64 github.com/gravitational/teleport/lib/services/local.(*IdentityService).GetUsers
/home/sasha/go/src/github.com/gravitational/teleport/lib/auth/auth.go:1886 github.com/gravitational/teleport/lib/auth.(*Server).GetUsers
/home/sasha/go/src/github.com/gravitational/teleport/lib/auth/init.go:1155 github.com/gravitational/teleport/lib/auth.migrateMFADevices
/home/sasha/go/src/github.com/gravitational/teleport/lib/auth/init.go:496 github.com/gravitational/teleport/lib/auth.migrateLegacyResources
/home/sasha/go/src/github.com/gravitational/teleport/lib/auth/init.go:465 github.com/gravitational/teleport/lib/auth.Init
/home/sasha/go/src/github.com/gravitational/teleport/lib/service/service.go:1125 github.com/gravitational/teleport/lib/service.(*TeleportProcess).initAuthService
/home/sasha/go/src/github.com/gravitational/teleport/lib/service/service.go:694 github.com/gravitational/teleport/lib/service.NewTeleport
/home/sasha/go/src/github.com/gravitational/teleport/lib/service/service.go:432 github.com/gravitational/teleport/lib/service.newTeleportProcess
/home/sasha/go/src/github.com/gravitational/teleport/lib/service/service.go:442 github.com/gravitational/teleport/lib/service.Run
/home/sasha/go/src/github.com/gravitational/teleport/tool/teleport/common/teleport.go:213 github.com/gravitational/teleport/tool/teleport/common.OnStart
/home/sasha/go/src/github.com/gravitational/teleport/tool/teleport/common/teleport.go:190 github.com/gravitational/teleport/tool/teleport/common.Run
/home/sasha/go/src/github.com/gravitational/teleport/tool/teleport/main.go:26 main.main
/usr/local/go/src/runtime/proc.go:204 runtime.main
/usr/local/go/src/runtime/asm_amd64.s:1374 runtime.goexit
User Message: initialization failed
MFA device named "otp" already exists
@klizhentas
Copy link
Author

User that crashes:

/web/users/bob/pwd|1613157143035426417||
/web/users/bob/mfa/aab2b0fc-488d-44c9-80d3-d7e4fd7780ec|1613157277438997518||{"kind":"mfa_device","version":"v1","metadata":{"Name":"otp","Namespace":"default"},"id":"aab2b0fc-488d-44c9-80d3-d7e4fd7780ec","addedAt":"2021-02-12T19:14:37.438860130Z","lastUsed":"2021-02-12T19:14:37.438860130Z","totp":{"key":"EUNCEQHQS3UNJB3K"}}
/web/users/bob/mfa/50b99293-6fcd-4116-9eb1-3ab7f84d335d|1613157293121810049||{"kind":"mfa_device","version":"v1","metadata":{"Name":"otp","Namespace":"default"},"id":"50b99293-6fcd-4116-9eb1-3ab7f84d335d","addedAt":"2021-02-12T19:14:53.121533557Z","lastUsed":"2021-02-12T19:14:53.121533557Z","totp":{"key":"EUNCEQHQS3UNJB3K"}}
/web/users/bob/mfa/b3c6b1f8-5b9c-4fd1-b9b0-45aa417aa09c|1613157317732052136||{"kind":"mfa_device","version":"v1","metadata":{"Name":"otp","Namespace":"default"},"id":"b3c6b1f8-5b9c-4fd1-b9b0-45aa417aa09c","addedAt":"2021-02-12T19:15:17.731506231Z","lastUsed":"2021-02-12T19:15:17.731506231Z","totp":{"key":"EUNCEQHQS3UNJB3K"}}

@klizhentas
Copy link
Author

DEBU [AUTH] Migrating MFA devices in LocalAuth for user "sasha" auth/init.go:1207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment