Skip to content

known_hosts SSH verification failing for gitlab.com #40297

@bryannagle

Description

@bryannagle

When using Julia 1.6, running "activate" on a module that has unregistered dependencies that use git ssh urls to private repositories, the update will fail if an entry for that repository host (i.e. gitlab) is present in the users ~/.ssh/known_hosts file. Removing that entry fixes the problem, but then the entry is re-added when the user pushes to git.

Steps to Reproduce:

  1. Clone a gitlab project using the SSH url.
  2. In a project, using package mode, run "add git@gitlab.com:"
  3. Commit your updated toml file to gitlab.
  4. Run "activate" from package mode.

Repl Example:

(LiquidIAM) pkg> update
Updating registry at ~/.julia/registries/General
Updating git-repo git@gitlab.com:LiquidAnalytics/opensource/liquiddatautils.jl.git
SSH host verification: the identity of the server gitlab.com:22 does not match its known hosts record. Someone could be trying to man-in-the-middle your connection. It is also possible that the server has changed its key, in which case you should check with the server administrator and if they confirm that the key has been changed, update your known hosts file.
ERROR: failed to fetch from git@gitlab.com:LiquidAnalytics/opensource/liquiddatautils.jl.git, error: GitError(Code:ERROR, Class:Net, user cancelled hostkey check)

(LiquidIAM) pkg>

shell> rm ~/.ssh/known_hosts

(LiquidIAM) pkg> update
Updating registry at ~/.julia/registries/General
Updating git-repo git@gitlab.com:LiquidAnalytics/opensource/liquiddatautils.jl.git
Updating git-repo git@gitlab.com:LiquidAnalytics/opensource/dgraph.jl.git
Updating git-repo git@gitlab.com:LiquidAnalytics/LiquidDecisions/Goals/DistributeGoal.git
Installed AWS ─ v1.33.1
No Changes to ~/Workspace/liquid/liquidiam.jl/Project.toml
Updating ~/Workspace/liquid/liquidiam.jl/Manifest.toml
[fbe9abb3] ↑ AWS v1.32.0 ⇒ v1.33.1
Progress [========================================>] 6/6
6 dependencies successfully precompiled in 22 seconds (68 already precompiled)

(LiquidIAM) pkg>

Metadata

Metadata

Assignees

No one assigned

    Labels

    libgit2The libgit2 library or the LibGit2 stdlib modulesecuritySystem security concerns and vulnerabilities

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions