spring-cloud / spring-cloud/spring-cloud-config

Log message if branch doesn't exist

Open
#1,481 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

task
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the configuration-server request path shown in the logs and inspect the repeated GitCredentialsProviderFactory activity. Reproduce the Git backend request with a branch that does not exist, comparing it with the repository successfully cloned in /tmp. Done means the missing-branch condition produces a clear log message.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.