Hi,

We are using spring-cloud-config-server with on one side, a Git repo, and on another side, Vault. We migrated our codebase from an on premise Gitlab to Github. Below, you will find our application configuration :

application.yml

server:
  servlet:
    contextPath: /configuration-server
  port: 8888
spring:
  cloud:
    config:
      server:
        vault:
          order: 1
          host: ${VAULT_HOST}
          port: ${VAULT_PORT}
          kv-version: ${VAULT_KV_VERSION}
          scheme: ${VAULT_SCHEME}
          backend: ${VAULT_BACKEND}
          profileSeparator: /
        git:
          order: 2
          uri: ${GIT_URI}
          search-paths: '{application}'
          default-label: ${DEFAULT_BRANCH:master}
          proxy:
            http:
              host: ${HTTP_PROXY_HOST:localhost}
              port: ${HTTP_PROXY_PORT:3128}
              non-proxy-hosts: ${HTTP_NON_PROXY_HOSTS:}
          strict-host-key-checking: true
          ignore-local-ssh-settings: true
          private-key: ${GIT_ACCESS_PRIVATE_KEY:changeit}
          passphrase: ${GIT_ACCESS_PASSPHRASE:changeit}
          host-key: ${GIT_ACCESS_HOST_KEY:changeit}
          host-key-algorithm: ${GIT_ACCESS_HOST_KEY_ALGORITHM:ssh-rsa}

  profiles:
    active: git, vault
~/.ssh/known_hosts

github.com <key of github>

We are facing a really weird issue. In fact, services that want to get their config do not get any answers from the config-server.

26/09/2019 14:15:272019-09-26 12:15:27.473  INFO 1 --- [           main] c.d.s.c.ConfigurationServerApplication   : The following profiles are active: git,vault
26/09/2019 14:15:292019-09-26 12:15:29.617  INFO 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=87f4533b-45a0-3f0b-95e0-886cbe6cd0fd
26/09/2019 14:15:292019-09-26 12:15:29.696  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$3513c404] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
26/09/2019 14:15:302019-09-26 12:15:30.636  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8888 (http)
26/09/2019 14:15:302019-09-26 12:15:30.762  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
26/09/2019 14:15:302019-09-26 12:15:30.762  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.17]
26/09/2019 14:15:302019-09-26 12:15:30.941  INFO 1 --- [           main] o.a.c.c.C.[.[.[/configuration-server]    : Initializing Spring embedded WebApplicationContext
26/09/2019 14:15:302019-09-26 12:15:30.941  INFO 1 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3373 ms
26/09/2019 14:15:342019-09-26 12:15:34.692  INFO 1 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
26/09/2019 14:15:362019-09-26 12:15:36.238  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
26/09/2019 14:15:362019-09-26 12:15:36.705  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8888 (http) with context path '/configuration-server'
26/09/2019 14:15:362019-09-26 12:15:36.727  INFO 1 --- [           main] c.d.s.c.ConfigurationServerApplication   : Started ConfigurationServerApplication in 13.315 seconds (JVM running for 14.37)
26/09/2019 14:15:402019-09-26 12:15:40.105  INFO 1 --- [nio-8888-exec-1] o.a.c.c.C.[.[.[/configuration-server]    : Initializing Spring DispatcherServlet 'dispatcherServlet'
26/09/2019 14:15:402019-09-26 12:15:40.106  INFO 1 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
26/09/2019 14:15:402019-09-26 12:15:40.116  INFO 1 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 10 ms
26/09/2019 14:15:412019-09-26 12:15:41.091 DEBUG 1 --- [nio-8888-exec-1] .s.c.c.s.s.GitCredentialsProviderFactory : Constructing PassphraseCredentialsProvider for URI git@github.com:<group-name>/<project-name>.git
26/09/2019 14:15:422019-09-26 12:15:42.903 DEBUG 1 --- [nio-8888-exec-1] .s.c.c.s.s.GitCredentialsProviderFactory : Constructing PassphraseCredentialsProvider for URI git@github.com:<group-name>/<project-name>.git
... same message over and over

However, the git repo is well cloned in /tmp.

The issue is produced from amazon containers managed with Rancher and that used a proxy.

Any idea ?

Regards.

Comment From: ecattez

After investigating, I realized that the remote config-repo branch I set in default-label in application.yml did not exist. It would be interesting to add a log to inform about this error. The error message sent by the EnvironmentController should be revelant.

Comment From: spencergibb

so you want to log a message if a branch doesn't exist?

Comment From: ecattez

Exactly. It would be more precise about what really happened.