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

ssh validation error should have more information #7725

Open
jsoref opened this issue Nov 16, 2021 · 4 comments
Open

ssh validation error should have more information #7725

jsoref opened this issue Nov 16, 2021 · 4 comments
Labels
component:cli Affects the Argo CD CLI component:ui User interfaces bugs and enhancements enhancement New feature or request type:supportability Enhancements that help operators to run Argo CD type:usability Enhancement of an existing feature

Comments

@jsoref
Copy link
Member

jsoref commented Nov 16, 2021

Summary

Provide details about what ssh connection failed and make it easier to act on this information

Motivation

When #7723 happened, we got some very unhelpful messages:

rpc error: code = Unknown desc = ssh: handshake failed: knownhosts: key mismatch argocd

image

TYPE NAME REPOSITORY CONNECTION STATUS ...
git git@github.com:... ❌ Failed
git git@github.com:... ❌ Failed
helm argo https://argoproj.github.io/argo-helm ✅ Successful

image

SERVER NAME CERT TYPE CERT INFO ...
bitbucket.org ssh ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A
github.com ssh ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
gitlab.com ssh ecdsa-sha2-nistp256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw
gitlab.com ssh ssh-ed25519 SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8
gitlab.com ssh ssh-rsa SHA256:ROQFvPThGrW4RuWLoL9tq9I9zJ42fK4XywyRtbOz/EQ
ssh.dev.azure.com ssh ssh-rsa SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og
vs-ssh.visualstudio.com ssh ssh-rsa SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og

Proposal

  • The ssh: handshake failed error should report:
    1. destination host
    2. expected keys
    3. received keys
  • Everything that links to that error state should include that information
  • The App view for this error should link back to the /settings/repos page
  • Repositories on the Repositories page should link to the /settings/certs page
@jsoref jsoref added the enhancement New feature or request label Nov 16, 2021
@jannfis jannfis added component:cli Affects the Argo CD CLI component:ui User interfaces bugs and enhancements type:supportability Enhancements that help operators to run Argo CD type:usability Enhancement of an existing feature labels Nov 17, 2021
@jannfis
Copy link
Member

jannfis commented Nov 17, 2021

I agree that we must improve error reporting (and not only in this special place).

However, for some of the information we rely on third-party libraries (e.g. go-git and x/crypto/ssh) to provide us with the the details. Emitting the host name in the error message should be a quick fix, but getting details about the expected and received key material is something that we probably cannot solve in Argo CD code. I'd be glad if someone proves me wrong, tho :)

@jsoref
Copy link
Member Author

jsoref commented Nov 17, 2021

I'll take whatever incremental bits I can get. For the rest, if people could file issues and cross link, that'd be great. I didn't have enough information from the error to even know where to file the rest of the bug 😦 .

@alexmt
Copy link
Collaborator

alexmt commented Nov 17, 2021

Fixed by #7722 . The fix is available in v2.1.7 release

@alexmt alexmt closed this as completed Nov 17, 2021
@jsoref
Copy link
Member Author

jsoref commented Nov 17, 2021

Err, this is not about the fact that github isn't working, it's about the error reporting for when any ssh server isn't working.

@jsoref jsoref reopened this Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:cli Affects the Argo CD CLI component:ui User interfaces bugs and enhancements enhancement New feature or request type:supportability Enhancements that help operators to run Argo CD type:usability Enhancement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants