2

I have only found this issue reported in 1 other place, but no resolution: https://github.com/spring-cloud/spring-cloud-config/issues/2052

I'm on 2021.0.3. When defining anything other than the default localhost:8888 using spring.config.import, it calls my specified server, then it calls localhost:8888, which fails and the application will not start up.

application.properties:

spring.application.name=msgw(_)application
spring.config.import=aws-secretsmanager:${ENVIRONMENT}/secret/path,configserver:https://my.server.com
spring.cloud.config.label=${CONFIGURATION_GIT_BRANCH}
spring.cloud.config.username=${username}
spring.cloud.config.password=${password}

Startup logs:

2022-09-01 07:50:58.763 |  | restartedMain | INFO | Fetching config from server at : https://my.server.com | org.springframework.cloud.config.client.ConfigServerConfigDataLoader | logTo | 255 |
2022-09-01 08:16:13.903 |  | restartedMain | INFO | Located environment: name=msgw/application, profiles=[dev], label=prod, version=401ea4bb26f13d49602a30e20997dff088d62934, state=null | org.springframework.cloud.config.client.ConfigServerConfigDataLoader | logTo | 255 |
2022-09-01 07:50:58.763 |  | restartedMain | INFO | Loading secrets from AWS Secret Manager secret with name: dev/secret/path, optional: false | io.awspring.cloud.secretsmanager.AwsSecretsManagerPropertySources | logTo | 255 |
2022-09-01 07:50:58.763 |  | restartedMain | INFO | Fetching config from server at : http://localhost:8888 | org.springframework.cloud.config.client.ConfigServerConfigDataLoader | logTo | 255 |
2022-09-01 07:50:58.763 |  | restartedMain | INFO | Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available | org.springframework.cloud.config.client.ConfigServerConfigDataLoader | logTo | 255 |
2022-09-01 07:50:58.764 |  | restartedMain | INFO | Fetching config from server at : http://localhost:8888 | org.springframework.cloud.config.client.ConfigServerConfigDataLoader | logTo | 255 |
2022-09-01 07:50:58.764 |  | restartedMain | INFO | Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available | org.springframework.cloud.config.client.ConfigServerConfigDataLoader | logTo | 255 |
2022-09-01 07:50:58.793 |  | restartedMain | ERROR | Application run failed

POM:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>2021.0.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
...
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>

1 Answers1

0

Seems my issue was trying to import the aws secret needed to access my server in the same spring.config.import config as my config server. So I'll just need to inject the username password a different way. I thought I tested without both imports, but I had to wipe my target directory and repackage for it to work.