adrianmcguirre
adrianmcguirre

Reputation: 13

Spring Cloud Config Server: error: No such label: master

when I access the url http://localhost:8888/actuator/health y have this error

{
    "status": "DOWN",
    "details": {
        "diskSpace": {
            "status": "UP",
            "details": {
                "total": 457192763392,
                "free": 347865096192,
                "threshold": 10485760
            }
        },
        "refreshScope": {
            "status": "UP"
        },
        "configServer": {
            "status": "DOWN",
            "details": {
                "repository": {
                    "application": "app",
                    "profiles": "default"
                },
                "error": "org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: master"
            }
        }
    }
}

my application.yml

enter image description here

Upvotes: 1

Views: 2504

Answers (4)

karan sisodiya
karan sisodiya

Reputation: 41

I was getting the same issue, and resolved it by making the two below changes:

  1. spring.cloud.config.server.git.uri=E:/spring_microservice/git-localconfig-repo

  2. Added forward slash (/) everywhere.

Upvotes: 1

Kapil Thakkar
Kapil Thakkar

Reputation: 870

Check your property file name and request file name. I was getting same and resolved by making two below changes.

1st Change: spring.cloud.config.server.git.uri=E:\\\\spring_microservice\\\\git-localconfig-repo

Removed file///...... and added 4 slash (\\)

2nd Change: Actually i was making request with incorrect property file name. I was making request like http://localhost:8888/limit-servers/default but correct file name is limit-server.properties so i have correct the request as below.

http://localhost:8888/limit-server/default

And it worked for me.

Upvotes: 1

Mohamed Larbi Soufi
Mohamed Larbi Soufi

Reputation: 1

You can simply add in your configuration file application.properties or apllication.yml, the following line of code :

- For people that use application.properties file :

spring.cloud.config.server.git.default-label=main

- For people that use application.use file :

spring: cloud: config: server: git: default-label: main

Upvotes: 0

amseager
amseager

Reputation: 6391

By default, spring cloud server tries to get properties from branch "master" in the git repository. Your repository doesn't have it (you have branch "main" instead).

You can use property default-label to set custom branch name (see docs):

spring:
  cloud:
    config:
      server:
        git:
          default-label: main

Or, you can rename your branch to master and leave all other things as they are.

Upvotes: 3

Related Questions