in28minutes / spring-microservices-v2

Microservices + Spring Boot 2 + Spring Cloud + Docker + Kubernetes - https://www.udemy.com/course/microservices-with-spring-boot-and-spring-cloud/. Latest Repo - http://github.com/in28minutes/spring-microservices-v3
751 stars 962 forks source link

limits-service not giving response after config-server connection to git is established and limits-service to config-server is being established #9

Open bethasandeep opened 3 years ago

bethasandeep commented 3 years ago

1) Response for localhost:8080/limits

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Jul 04 23:57:43 IST 2021 There was an unexpected error (type=Not Found, status=404). No message available

2) Response for localhost:8888/limits-service/default

{ "name": "limits-service", "profiles": [ "default" ], "label": null, "version": "03b39032523e4d27b1df6876307a6855145f78c8", "state": null, "propertySources": [ { "name": "file:///C:/Users/sande/git-local-config-repo/file:C:\Users\sande\git-local-config-repo\limits-service.properties", "source": { "limit-service.minimum": "4", "limit-service.maximum": "996" } } ] }

rest assured, everything is as per the tutorial. Kindly help me on this

bethasandeep commented 3 years ago

Please find the following errors being shown on console:

Adding property source: Config resource 'file [C:\Users\sande\git-local-config-repo\limits-service.properties]' via location 'file:/C:/Users/sande/git-local-config-repo/' Could not merge remote for master remote: null

SimonSongCA commented 2 years ago

Same issue here. I was following the instructions within the course and also the instructions on the GitHub website.

My problem is the response takes too long (3 minutes) after I entered 'localhost:8888/limits-service/default' to have the output, with org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: main given at the console.

The other thing I would like to mention about is that: no matter whether or not I configure spring.cloud.config.server.git.default-label=main, the such a delay persists and the final response is correct.

As for the org.springframework.cloud.config.server.environment.NoSuchLabelException(which I saw it in the console while the config service was running), I was instructed to add spring.cloud.config.server.git.default-label=main since I was encountering org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: master. But when I put spring.cloud.config.server.git.default-label=main into applications.properties at spring-cloud-config-server project, it shows org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: main.

When I removed spring.cloud.config.server.git.default-label=main', the missinglabelshould've come back tomaster, but it still appeared asmain` even I restarted the config service.

It seems like neither main nor master is found under such a configuration, and the configuration does not have full control of what label it should be referring to.

Does everyone have the same problem as I do?

Best, Simon

00anshjain commented 1 year ago

Remove spring.config.import=optional:configserver:http://localhost:8888 from limits-service.properties, then restart spring-cloud-config-server. It worked for me.