What I am trying to do is to connect to a remote git repository on BitBucket, But I keep getting an exception 2021-12-16 01:04:20.856 INFO 5728 --- [nio-8888-exec-1] .c.s.e.MultipleJGitEnvironmentRepository : Will try to checkout master label instead. 2021-12-16 01:04:22.276 WARN 5728 --- [nio-8888-exec-1] .c.s.e.MultipleJGitEnvironmentRepository : Error occured cloning to base directory. org.eclipse.jgit.api.errors.TransportException: git@bitbucket.org:tcavanagh/hp-fetcher-configurations.git: failed to send channel request Exceptions.txt
It wont tell me why it cant clone to base directory, or even where base directory is. I have an application yml which contains all the details I have set up. It includes a private key, but that is ok I will regenerate a new one. application.yml.txt
And the exceptions, Exceptions.txt
The error may be in how I am calling it. I am http://localhost:8888/application/default application being the name of the application.yml file.
Comment From: ryanjbaxter
Is this not the same as https://github.com/spring-cloud/spring-cloud-config/issues/2013?
Comment From: AnthonyCavanagh
2013? was to complicated a ticket, This is more neater.
Comment From: vlagorce
Facing same issue after upgrading from spring-boot-starter-parent 2.5.3 to spring-boot-starter-parent 2.6.3 from spring-cloud-dependencies 2020.0.5 to spring-cloud-dependencies 2021.0.0
jgit upgrade from 5.1.3.201810200350-r to 5.12.0.202106070339-r might be the cause.
Comment From: vlagorce
The use of org.eclipse.jgit.ssh.jsch
Comment From: bogoevskig
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
Comment From: vlagorce
git config --global protocol.version 1
Is the same as adding the following lines in the Git configuration file ($HOME/.gitconfig)
[protocol]
version = 1
Fixed the issue "failed to send channel request" Thx @bogoevskig
Comment From: vlagorce
INFO --- [nio-8080-exec-2] onment.MultipleJGitEnvironmentRepository : Could not refresh default label main
INFO --- [nio-8080-exec-2] onment.MultipleJGitEnvironmentRepository : Will try to checkout master label instead.
Fixed using "SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT_LABEL" = "master"
Comment From: Bryksin
The same problem, I just upgraded the config service to the latest Spring Boot and suddenly default label become "main" instead of "master" and it stop checking out code without even telling why.
Just getting Warning message:
.c.s.e.MultipleJGitEnvironmentRepository : Could not fetch remote for master remote <my_repo_url>
With a bit of debugging and intercepting internal exceptions I found this:
org.eclipse.jgit.errors.TransportException: <my_repo_url>: failed to send channel request
what is also not very informative
Configuring git config --global protocol.version 1 considering service runs in docker in EKS doesn't feel right as a docker at OS level doesn't even have git installed and fully rely on Config Service java libs
Is there a way to set this protocol version from the application.yml file?
Or what is required to fix to get it working through a new protocol? We use self-hosted GitLab?
Comment From: ns-rkusumoto
Attempting to set in application.yml: spring.cloud.config.server.git.defaultLabel or default-label to master does not seem to work. It's always going to main then master (and since I don't have a main branch, gettings a lot of java logs).
Using Spring Cloud Config in a container.
Comment From: ryanjbaxter
spring.cloud.config.server.git.defaultLabel should work, but that is a different issue.
Comment From: ryanjbaxter
We ultimately will need a way to set the protocol via a jgit api and thus far I have yet to find such an api. As far as I can see the only way to do it is by setting the git config
Comment From: ryanjbaxter
Duplicate of https://github.com/spring-cloud/spring-cloud-config/issues/2015