【发布时间】:2017-04-26 18:34:55
【问题描述】:
我部署了 Spring 云配置服务器以通过 ssh 连接到 git 存储库。
spring:
cloud:
config:
server:
git:
uri: ssh://git@stash.ops.domain.com:2022/ccare/cm-config-data.git
searchPaths: [preferences, orders]
我已将 ssh 密钥 (id_rsa.pub) 添加到 Git 存储区。 我还添加了 /.ssh/config 文件,没有 StrictHostKeyChecking 选项。 但是当我访问配置服务器时,我仍然不断收到此错误。
[nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Cannot clone or checkout repository] with root cause
com.jcraft.jsch.JSchException:UnknownHostKey:stash.ops.domain.com。 RSA 密钥指纹为 39:89:4b:aa:79:fc:01:9f:46:48:5b:b9:6f:17:af:d5 在 com.jcraft.jsch.Session.checkHost(Session.java:786) 在 com.jcraft.jsch.Session.connect(Session.java:342) 在 org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116) 在 org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136) 在 org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.(TransportGitSsh.java:262) 在 org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161) 在 org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) 在 org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) 在 org.eclipse.jgit.transport.Transport.fetch(Transport.java:1115) 在 org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130) 在 org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:178) 在 org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:125) 在 org.springframework.cloud.config.server.JGitEnvironmentRepository.cloneToBasedir(JGitEnvironmentRepository.java:265) 在 org.springframework.cloud.config.server.JGitEnvironmentRepository.copyRepository(JGitEnvironmentRepository.java:237)
【问题讨论】: