vscode-gitlens
vscode-gitlens copied to clipboard
Unhelpful `"key" has fingerprint "IP"` prompt on invalid host key
Description
Environment: a VSCode JS + TypeScript standard devcontainer with the GitLens extension installed
Problem
I got the cryptic yes/no VSCode prompt "key" has fingerprint "IP" (see attached screenshot) when trying to pull from a Git repository with GitLens in a devcontainer (running on Docker Desktop on macOS).
I occurred in both these cases:
- When I had one invalid ECDSA host key in my
~/.ssh/known_hosts - When I had both an invalid & valid host key in that same file
Workaround
I disabled GitLens, and tried running git pull in the terminal instead. That lead to this more descriptive prompt in the terminal:
Warning: the ECDSA host key for 'github.com' differs from the key for the IP address '140.82.121.4'
Offending key for IP in /home/node/.ssh/known_hosts:19
Matching host key in /home/node/.ssh/known_hosts:46
Are you sure you want to continue connecting (yes/no)?
The offending key was the old Github fingerprint. The "Matching host key" was one I just added while trying to debug this, by copying the values from this page.
This prompt helped me to remove the outdated entries from my known_hosts.
Expected behavior
Showing a prompt with more information, along the lines of git's own output, would be much more helpful.
GitLens Version
14.3.0
VS Code Version
Version: 1.82.0 (Universal) Commit: 8b617bd08fd9e3fc94d14adb8d358b56e3f72314 Date: 2023-09-06T22:09:41.364Z (1 wk ago) Electron: 25.8.0 ElectronBuildId: 23503258 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin arm64 22.5.0
Git Version
git version 2.42.0
Logs, Screenshots, Screen Captures, etc
This prompt is coming from VS Code not GitLens, please open an issue on the VS Code repository. Thanks!
Can someone provide a link to the VSCode issue?