Skip to content

Show a warning in tsh when connecting to a too old cluster#43461

Merged
gzdunek merged 5 commits intomasterfrom
gzdunek/tsh-version-warn
Aug 13, 2024
Merged

Show a warning in tsh when connecting to a too old cluster#43461
gzdunek merged 5 commits intomasterfrom
gzdunek/tsh-version-warn

Conversation

@gzdunek
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek commented Jun 25, 2024

As per our compatibility promise, we don't support clients newer than servers. Unfortunately, we don't show any warning about it, so tsh may suddenly fail (like here https://gravitational.slack.com/archives/C01TYKHFVTQ/p1718877334960729).
The only warning we have is about too old clients.

The new warning looks as below:

grzegorz@mbp build % ./tsh --proxy=teleport-ent-16.asteroid.earth login

WARNING
Detected potentially incompatible client and server versions.
Maximum client version supported by the server is 16.x.x but you are using 17.0.0-dev.
Please downgrade tsh to 16.x.x or use the --skip-version-check flag to bypass this check.
Future versions of tsh will fail when incompatible versions are detected.

changelog: tsh now shows a warning when connecting to a cluster on an older major version. More on client compatibility https://goteleport.com/docs/upgrading/overview/#component-compatibility

Comment thread lib/client/api.go
// Verify server->client and client->server compatibility.
if tc.CheckVersions {
if !utils.MeetsVersion(teleport.Version, pr.MinClientVersion) {
if !utils.MeetsMinVersion(teleport.Version, pr.MinClientVersion) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that the minimum version check will even work with a cluster >=v16.0.0 now that unsupported client connections are terminated by Auth. In my testing I'm seeing an EOF error during login prior to getting into this check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it's because webclient.Ping above returns an empty pr.MinClientVersion string (so utils.MeetsVersion returns true). Do you maybe know why it happens?

@zmb3
Copy link
Copy Markdown
Collaborator

zmb3 commented Jun 25, 2024

Does the skip version flag actually work with tsh?

@gzdunek
Copy link
Copy Markdown
Contributor Author

gzdunek commented Jun 27, 2024

Does the skip version flag actually work with tsh?

Yeah, passing --skip-version-check hides the warnings, but if the connection is terminated by the server, it obviously won't help.

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from AntonAM July 1, 2024 02:25
@gzdunek gzdunek added this pull request to the merge queue Aug 12, 2024
github-merge-queue Bot pushed a commit that referenced this pull request Aug 12, 2024
* `MeetsVersion` -> `MeetsMinVersion`

* Add `MeetsMaxVersion`

* Show a warning if tsh version is newer than server
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2024
@gzdunek gzdunek added this pull request to the merge queue Aug 13, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 13, 2024
@gzdunek gzdunek added this pull request to the merge queue Aug 13, 2024
Merged via the queue into master with commit ca05dd1 Aug 13, 2024
@gzdunek gzdunek deleted the gzdunek/tsh-version-warn branch August 13, 2024 09:51
@public-teleport-github-review-bot
Copy link
Copy Markdown

@gzdunek See the table below for backport results.

Branch Result
branch/v16 Create PR

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants