克隆到基本目录时出错git@bitbucket.org:myapp/configurations.git无法发送通道请求



当我尝试将spring-cloud-config连接到比特桶回购时,我收到了以下错误。

.c.s.e.MultipleJGitEnvironmentRepository : Error occured cloning to base directory.
org.eclipse.jgit.api.errors.TransportException: git@bitbucket.org:myapp/configurations.git: failed to send channel request
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:224) ~[org.eclipse.jgit-5.12.0.202106070339-r.jar:5.12.0.202106070339-r]
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:303) ~[org.eclipse.jgit-5.12.0.202106070339-r.jar:5.12.0.202106070339-r]
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:178) ~[org.eclipse.jgit-5.12.0.202106070339-r.jar:5.12.0.202106070339-r]
Caused by: com.jcraft.jsch.JSchException: failed to send channel request
at com.jcraft.jsch.Request.write(Request.java:65) ~[jsch-0.1.55.jar:na]
at com.jcraft.jsch.RequestEnv.request(RequestEnv.java:52) ~[jsch-0.1.55.jar:na]
at com.jcraft.jsch.ChannelSession.sendRequests(ChannelSession.java:222) ~[jsch-0.1.55.jar:na]
at com.jcraft.jsch.ChannelExec.start(ChannelExec.java:41) ~[jsch-0.1.55.jar:na]
at com.jcraft.jsch.Channel.connect(Channel.java:152) ~[jsch-0.1.55.jar:na]
at org.eclipse.jgit.transport.JschSession$JschProcess.<init>(JschSession.java:159) ~[org.eclipse.jgit.ssh.

我不知道这个消息是什么意思频道请求。这些是我的yml设置

spring:
cloud:
config:
server:
git:
uri: git@bitbucket.org:myapp/configurations.git
default-label: main
clone-on-start: true
ignore-local-ssh-settings: true
privateKey : |
-----BEGIN RSA PRIVATE KEY-----
**************************************
**************************************
-----END RSA PRIVATE KEY-----

我需要在yml文件中为通道设置一些东西吗

在Spring Cloud Config 3.1.0(Spring Cloud 2021.0.0(中得到了相同的错误。看起来这与JGit自5.11 版本以来从V1切换到V2的git协议版本有关

在客户端将git协议版本切换回V1解决了此问题。您可以通过在JGit配置文件($HOME/.config/JGit(中添加以下行来完成此操作

[protocol]
version = 1

或者您可以使用更新全局git协议版本

git config --global protocol.version 1

检查URI是否正确。就我而言,这是完全错误的。

尝试在URL的前面插入ssh:\,使其成为uri: ssh://git@bitbucket.org:myapp/configurations.git

最新更新