title: Spring Cloud Config - Git Repository Errors
body: <p><strong>Spring Cloud Config Framework:</strong></p>
  
  <p>I'm trying to integrate spring cloud config in java project with backend repository <strong>git</strong> which is bitbucket. Basically, I encounter two errors more frequently on different occasions.</p>
  
  <pre><code>2020-04-11 17:08:59.265  WARN 2792 --- [           main] .c.s.e.MultipleJGitEnvironmentRepository : Could not fetch remote for master remote: https://user@bitbucket.org/workspace/config-repo.git
  </code></pre>
  
  <p>In the above case, it uses the cached version and tomcat/undertow server start without any problems.</p>
  
  <pre><code>2020-04-11 17:09:03.774  INFO 2792 --- [           main] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/var/folders/6m/1cgw7zvn3rsb8j5kskflhvrr0000gn/T/config-repo-2822438633438126334/api-gateway.yml
  2020-04-11 17:09:03.774  INFO 2792 --- [           main] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/var/folders/6m/1cgw7zvn3rsb8j5kskflhvrr0000gn/T/config-repo-2822438633438126334/discovery-service.yml
  2020-04-11 17:09:03.775  INFO 2792 --- [           main] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/var/folders/6m/1cgw7zvn3rsb8j5kskflhvrr0000gn/T/config-repo-2822438633438126334/config-service.yml
  </code></pre>
  
  <p><strong>Git Version:</strong></p>
  
  <p><code>git version 2.24.0</code></p>
  
  <p><strong>Error 1: git-upload-pack</strong></p>
  
  <p>2020-04-11 00:00:20 - WARN Error occurred cloning to base directory.</p>
  
  <pre><code>org.eclipse.jgit.api.errors.TransportException: https://&lt;username&gt;@bitbucket.org/&lt;workspace&gt;/config-repo.git: git-upload-pack not permitted on 'https://beatles89@bitbucket.org/workspace/config-repo.git/'
  </code></pre>
  
  <p>Starting the spring cloud config server, and I received this error randomly. After digging into this issue, I found that <strong>git-upload-pack</strong> is not supported on bitbucket. But it was reported 2 years ago <a href="https://stackoverflow.com/questions/45563049/bitbucket-cannot-execute-git-upload-pack">here</a>, and suggested to revert the <strong>GIT</strong> version.</p>
  
  <p><strong>Error 2: authentication not supported</strong></p>
  
  <p><code>org.eclipse.jgit.api.errors.TransportException: https://bitbucket.org/user/repo.git: authentication not supported</code></p>
  
  <p>This above error I get when hit the <code>/refresh</code> on actuator to get the refreshed properties from remote config repository. Sometimes it work without any errors and sometimes it throws above error.</p>
  
  <p><code>curl localhost:8060/refresh -d {} -H "Content-Type: application/json"</code></p>
  
  <p><strong>Actuator Refresh Command Error:</strong></p>
  
  <pre><code>{"timestamp":"2020-04-10T16:35:41.144+0000","status":500,"error":"Internal Server Error","message":"Request processing failed; nested exception is org.springframework.cloud.config.server.environment.NoSuchRepositoryException: Cannot clone or checkout repository: https://beatles89@bitbucket.org/augmentedcloud/ac-config-repo.git","path":"/refresh"}
  </code></pre>
  
  <p><strong>Note:</strong> As a side note, I have cloned the specified repository separately for testing and it worked without any authentication issues.</p>