3

I am getting the following error when I try to connect spring cloud config to a bitbucket repo.

.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.

I have no idea what the message means channel request. These are my yml settings

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-----

Do I need to set something up in the yml file for channel

Tony
  • 363
  • 3
  • 17
  • Hi, I'm stuck with the same issue, did you manage to find any solution to this? – Ari Mar 22 '22 at 07:55
  • Tried with this git@bitbucket.org:project/repo.git >> failed to send channel request Tried with this ssh://git@bitbucket.org:project/repo.git >> appended with extra / Tried with this ssh://bitbucket.org/project/repo.git >> giving auth fail Now I'm confused – Ari Mar 22 '22 at 08:01

3 Answers3

1

Got the same error in Spring Cloud Config 3.1.0 (Spring Cloud 2021.0.0). Looks like it is related to the git protocol version switch from V1 to V2 in JGit since version 5.11

Switching the git protocol version back to V1 on client side resolved the issue. You can do it by adding the following lines in the JGit configuration file ($HOME/.config/jgit)

[protocol]
    version = 1

or you can update global git protocol version with

git config --global protocol.version 1
Goce
  • 491
  • 4
  • 3
  • Thanks but I moved away from this , it was just too complicated to get working,I used s3 instead – Tony Mar 24 '22 at 10:21
0

Check if the URI is correct. In my case it was completely wrong.

Ferlorin
  • 50
  • 3
  • Its correct. For a application with many moving parts , the documentation is a tad flakey. – Tony Dec 14 '21 at 16:11
  • Was everything else the same as mine. Am I missing anything in my yml, that you had. – Tony Dec 14 '21 at 21:12
0

try to insert ssh:\\ at the front of your URL making it uri: ssh://git@bitbucket.org:myapp/configurations.git

Ferlorin
  • 50
  • 3
  • 1
    thanks but you know jgit, if they can make life harder they will they process ssh://git@bitbucket.org:myapp/configurations.git into ssh:////git@bitbucket.org:myapp/configurations.git then throw a uri exception, – Tony Dec 14 '21 at 21:11