4

I'm attempting to run Spring Cloud Configuration Server, working through the examples in a book (Manning's Spring Microservices in Action), but updating to the latest versions: Java 17, spring-boot-starter-parent 2.6.1, with Spring Cloud 2021.0.0-RC1.

Each time I try to start the server, I get this error:

***************************
APPLICATION FAILED TO START
***************************

Description:

Invalid config server configuration.

Action:

If you are using the git profile, you need to set a Git URI in your configuration.  If you have set spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.

I am not using the git profile. I have tried two different profiles: native (with config files on the classpath) and vault (with a Hashicorp Vault server running locally). My latest /src/resources/bootstrap.yml contains the following:

spring:
    application:
        name: config-server
    profiles:
        active: vault
    cloud:
        config:
            server:
                vault:
                    port: 8200
                    host: 127.0.0.1
                    kvVersion: 2
server:
    port: 8071

My best guess is that the bootstrap.yml file isn't getting picked up at server startup, and perhaps the git profile is a default. How can I remedy this?

workerjoe
  • 2,421
  • 1
  • 26
  • 49

3 Answers3

2

OK, it looks like the problem here is that newer versions of Spring Cloud Configuration Server don't look for the bootstrap.yml file by default. There are a few different ways to solve it. The easiest is just to move all the properties to an application.yml/application.properties instead.

Another alternative is (found at NEWBEDEV here) is to include a dependency that implements the "legacy" bootstrap behavior:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
workerjoe
  • 2,421
  • 1
  • 26
  • 49
0

add the following into application.properties file.

spring.application.name=techefx-spring-cloud-config-server spring.cloud.config.server.git.uri=https://github.com/techefx/environment-variable-repo.git server.port= ${port:8888}

0

Please go through the link below:

Spring Cloud Config File System Backend Issue (not reading properties from the file)

Subarata Talukder
  • 5,407
  • 2
  • 34
  • 50