Invalid config server configuration

Viewed 3908

I am on learning stage of Spring Cloud & using spring version 2.4.3 and spring-cloud-version

2020.0.1 and I created two property file

application.yml

spring:
  application:
    name: cloud-server
 
server:
  port:  8888

bootstrap.yml

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/************/insurance-config-server
        default-label: main 

but still I got following 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 are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.

How to solve this kind of error?

2 Answers

Did you have a bootstrap.yml file?

I had the same problem. My project did not have a bootstrap.yml, but I specified a dev activity file in the IDEA startup configuration, which caused the same error as you did. The error could not be found bootstrap.yml on startup. After deleting dev in IDEA startup configuration, it can start normally.

If you are following the example in the book you referenced then I will suggest you move this

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/************/insurance-config-server
        default-label: main 

to application.yml

That is what I did and it worked for me

Related