ANURAG parchuri
ANURAG parchuri

Reputation: 175

Spring Cloud Config Server unable to connect to private git repositories

I am using the following helm chart https://hub.helm.sh/charts/kiwigrid/spring-cloud-config-server to deploy the spring cloud config server in my Kubernetes cluster. It works fine if I give a public repository but fails with the following error git-upload-pack not found: Not Found when given the private repository. I have checked my credentials and the one's I am passing are correct, the same shows up when I do a kubectl get secrets <secret> -o yaml

command used to install:

helm install spring-config kiwigrid/spring-cloud-config-server --version 0.1.0  --set config.gitUri=<git repo> --set secrets.gitUsername=<base64 encoded> --set secrets.gitPassword=<base64 encoded> --set service.type=NodePort

ERROR LOG:

2020-09-21 12:42:28.688  WARN 1 --- [nio-8888-exec-1] .c.s.e.MultipleJGitEnvironmentRepository : Error occured cloning to base directory.
org.eclipse.jgit.api.errors.TransportException: http://xxxxxx/demo/java_demo: 
http://xxxxx/demo/java_demo/git-upload-pack not found: Not Found
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:254) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200) ~[org.eclipse.jgit-5.1.3.201810200350-r.jar!/:5.1.3.201810200350-r]
        at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.cloneToBasedir(JGitEnvironmentRepository.java:589) [spring-cloud-config-server-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.copyRepository(JGitEnvironmentRepository.java:564) [spring-cloud-config-server-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.createGitClient(JGitEnvironmentRepository.java:547) [spring-cloud-config-server-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]

I am using gitlab as my code repository and it is HTTP. when I googled the error it says user might not have push/pull permissions but am able to do the same from cli with the same credentials that I have passed here. I am also able to access the git repository from UI.

Upvotes: 0

Views: 1172

Answers (1)

ANURAG parchuri
ANURAG parchuri

Reputation: 175

I got this to work by adding .git at the end of my repo name. For GitHub it was working when I gave just the repo name but if you are using GitLab give the .git extension at the end of your repo name.

Upvotes: 2

Related Questions