Make Teleport startup resilient to invalid roles (#9062)#9105
Merged
codingllama merged 1 commit intobranch/v8from Nov 23, 2021
Merged
Make Teleport startup resilient to invalid roles (#9062)#9105codingllama merged 1 commit intobranch/v8from
codingllama merged 1 commit intobranch/v8from
Conversation
Removing the old roles migration allows Teleport to start even in the face of invalid roles. The system will still be largely unusable, but `tctl rm` is now possible as a fallback. Added logging makes it easier to determine the bad role. Turns this scenario: ```shell $ teleport start > (...) > ERROR: initialization failed > could not parse 'where' rule: "!contains(ssh_session.participants, user.metadata.name)", error: ssh_session.participants is not defined > (teleport exits) ``` into this: ```shell $ teleport start > (...) > 2021-11-18T16:50:29-03:00 WARN [AUTH:1:CA] "Re-init the cache on error: role \"join_own_sessions_only\"\n\tcould not parse 'where' rule: \"!contains(ssh_session.participants, user.metadata.name)\", error: ssh_session.participants is not defined." cache/cache.go:725 > 2021-11-18T16:50:29-03:00 WARN [AUTH:1:CA] Cache "auth" first init failed, continuing re-init attempts in background. error:[ > ERROR REPORT: > Original Error: *trace.BadParameterError could not parse 'where' rule: "!contains(ssh_session.participants, user.metadata.name)", error: ssh_session.participants is not defined > Stack Trace: > (...) > User Message: role "join_own_sessions_only" > could not parse 'where' rule: "!contains(ssh_session.participants, user.metadata.name)", error: ssh_session.participants is not defined] cache/cache.go:678 > 2021-11-18T16:50:35-03:00 WARN [AUTH:1:CA] "Re-init the cache on error: role \"join_own_sessions_only\"\n\tcould not parse 'where' rule: \"!contains(ssh_session.participants, user.metadata.name)\", error: ssh_session.participants is not defined." cache/cache.go:725 > (teleport running, tctl works) ``` See #9059 for the larger context. * Remove Teleport 4.3 role migration * Remove unused parameters * Add role name to GetRoles validation failures
rosstimothy
approved these changes
Nov 23, 2021
quinqu
approved these changes
Nov 23, 2021
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing the old roles migration allows Teleport to start even in the face of invalid roles. The system will still be largely unusable, but
tctl rmis now possible as a fallback.Added logging makes it easier to determine the bad role.
Turns this scenario:
into this:
See #9059 for the larger context.