我在项目的deps.edn文件中添加了一个git依赖项。
当尝试使用“clj”依赖项启动repl(从而安装依赖项)时,安装失败,出现类似标题中所述的错误
构建类路径时出错。git@XXX:YYY/ZZZ.git: 未知主机密钥:XXX。RSA密钥指纹是 YYYYY
org.eclipse.jgit.api.errors.TransportException: git@XXX:YYY/ZZZ.git: 未知主机密钥:XXX。RSA密钥指纹是 YYYYY
...
原因:org.eclipse.jgit.errors.TransportException: git@XXX:YYY/ZZZ.git: 未知主机密钥:XXX。RSA密钥指纹是 YYYYY
...
原因:com.jcraft.jsch.JSchException: 未知主机密钥:git@XXX:YYY/ZZZ.git: 未知主机密钥:XXX。RSA密钥指纹是 YYYYY
...
造成此问题的原因似乎如下(如jgit中的b6e2800560dbf7348dcc1965e9069863ef96e4f5中描述的)
"""
...
JSch更喜欢ssh-rsa密钥类型。当远程服务器支持ssh-rsa时
key type then this key type will be used even if the known_hosts file
contains a host key for that host, but with different key type.
This caused an unexpected UnknownHostKey error.
...
"""
上面提到的jgit提交将有望解决此问题。
tools.gitlibs仍然依赖于不包含此提交的较旧版本的jgit。
因此,请逐级更新tools.gitlibs和tools.deps.alpha中的jgit版本。
目前只有一种解决方案(显然,之前也有人在此遇到问题)
https://codehopper.nl/2018/09/27/clojure-gitlab-deps/
(基本上:修改您的known_hosts和ssh-config-file,这在我的看法中非常不好)
完整的(被审查)跟踪
克隆:[email protected]:YYYYY/ZZZZ.git
构建类路径时出错。[email protected]:YYYYY/ZZZZ.git: 未知主机密钥:XXXXXX。RSA密钥指纹是 FF:II:NN:GG:EE:RR:PP:RR:II:NN:TT
org.eclipse.jgit.api.errors.TransportException: [email protected]:YYYYY/ZZZZ.git: 未知主机密钥:XXXXXX。RSA密钥指纹是 FF:II:NN:GG:EE:RR:PP:RR:II:NN:TT
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:248)
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:89)
at clojure.tools.gitlibs.impl$call_with_auth.invokeStatic(impl.clj:49)
at clojure.tools.gitlibs.impl$call_with_auth.invoke(impl.clj:41)
at clojure.tools.gitlibs.impl$git_clone_bare.invokeStatic(impl.clj:71)
at clojure.tools.gitlibs.impl$git_clone_bare.invoke(impl.clj:68)
at clojure.tools.gitlibs.impl$ensure_git_dir.invokeStatic(impl.clj:110)
at clojure.tools.gitlibs.impl$ensure_git_dir.invoke(impl.clj:100)
at clojure.tools.gitlibs$resolve.invokeStatic(gitlibs.clj:33)
at clojure.tools.gitlibs$resolve.invoke(gitlibs.clj:29)
at clojure.tools.gitlibs$procure.invokeStatic(gitlibs.clj:47)
at clojure.tools.gitlibs$procure.invoke(gitlibs.clj:41)
at clojure.tools.deps.alpha.extensions.git$eval894$fn__896.invoke(git.clj:41)
at clojure.lang.MultiFn.invoke(MultiFn.java:238)
at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:177)
at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:161)
at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:224)
at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:206)
at clojure.tools.deps.alpha.script.make_classpath$create_classpath.invokeStatic(make_classpath.clj:59)
at clojure.tools.deps.alpha.script.make_classpath$create_classpath.invoke(make_classpath.clj:52)
at clojure.tools.deps.alpha.script.make_classpath$run.invokeStatic(make_classpath.clj:70)
at clojure.tools.deps.alpha.script.make_classpath$run.invoke(make_classpath.clj:64)
at clojure.tools.deps.alpha.script.make_classpath$_main.invokeStatic(make_classpath.clj:109)
at clojure.tools.deps.alpha.script.make_classpath$_main.doInvoke(make_classpath.clj:84)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:702)
at clojure.core$apply.invokeStatic(core.clj:657)
at clojure.main$main_opt.invokeStatic(main.clj:317)
at clojure.main$main_opt.invoke(main.clj:313)
at clojure.main$main.invokeStatic(main.clj:424)
at clojure.main$main.doInvoke(main.clj:387)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:702)
at clojure.main.main(main.java:37)
原因:org.eclipse.jgit.errors.TransportException: [email protected]:YYYYY/ZZZZ.git: 未知主机密钥:XXXXXX。RSA密钥指纹是 FF:II:NN:GG:EE:RR:PP:RR:II:NN:TT
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:172)
at clojure.tools.gitlibs.impl.proxy$org.eclipse.jgit.transport.JschConfigSessionFactory$ff19274a.getSession(Unknown Source)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:137)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:123)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1269)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:237)
... 35 more
原因:com.jcraft.jsch.JSchException: 未知主机密钥:XXXXXX。RSA密钥指纹是 FF:II:NN:GG:EE:RR:PP:RR:II:NN:TT
at com.jcraft.jsch.Session.checkHost(Session.java:805)
at com.jcraft.jsch.Session.connect(Session.java:345)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:126)
... 43 more