Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring-cloud-config-server - Could not merge remote for master remote: null

I have developed config server using spring.

My Application.java is

@EnableConfigServer
@SpringBootApplication

public class SpringConfigServerApplication {

public static void main(String[] args) {
    SpringApplication.run(SpringConfigServerApplication.class, args);
}}

My bootstrap.properties file

#Server port
server.port = 8888

#Git repo location
spring.cloud.config.server.git.uri=file://Users/dineth/Documents/MyProjects/sample-git-sources/config-server-repo

My config-server-client-development.properties file

msg = Hello world - this is from config server – Development environment.

I have tiggered git init, git add and git commit commands to add my file to local git.

But when I run the app and go to http://localhost:8888/client-config/development

It does not show my property value.

// 20200406064430
// http://localhost:8888/client-config/development

{
"name": "client-config",
"profiles": [
"development"
],
"label": null,
"version": "4f989b109d1e6d77c8f44a664b275305ddddf014",
"state": null,
"propertySources": [

]
}

And Application log says:

WARN 2125 --- [nio-8888-exec-2] .c.s.e.MultipleJGitEnvironmentRepository : Could not merge remote for master remote: null

Did I miss anything?

I'm using macOS

like image 494
techmagister Avatar asked Apr 06 '20 01:04

techmagister


People also ask

How do I enable cloud config server?

Creating Spring Cloud Configuration Server Gradle users can add the below dependency in your build. gradle file. Now, add the @EnableConfigServer annotation in your main Spring Boot application class file. The @EnableConfigServer annotation makes your Spring Boot application act as a Configuration Server.

How does a PCF Config server work?

Config Server is an externalized application configuration service. It is based on the open-source Spring Cloud Config project, which provides a centralized server for delivering external configuration properties to an application and a central source for managing this configuration across deployment environments.


1 Answers

You need to run Config Server using the native profile when pointing your git repo to a local directory, in your case file://Users/dineth/Documents/MyProjects/sample-git-sources/config-server-repo

Just add the following line to the Config Server application.properties:

spring.profiles.active=native
like image 186
dbaltor Avatar answered Oct 08 '22 11:10

dbaltor