I am trying to connect to the spring cloud config server via a eureka registered serviceId. My Spring cloud config server is up and running , and my client can connect to it via local host. The Eureka server is up and running, and my spring config server is registered.
HP-FETCHER-CONFIG-SERVICE | n/a (1) | (1) | UP (1) - 192.168.0.19:hp-fetcher-config-service:8086
I have a application that is a eureka client, but I also want it to load config from the config server using the HP-FETCHER-CONFIG-SERVICE serviceId.
This is my clients application.yml
application.txt it has spring.cloud.config.discovery.enabled: true spring.cloud.config.discovery.serviceId: HP-FETCHER-CONFIG-SERVICE
I am using java 16 spring-boot-starter-parent 2.5.3 org.springframework.cloud 2020.0.3.
Getting the following exception
It can see but cant connect permision denied GET request for "http://192.168.0.19:8086/hp-fetcher-htmlunit/local": Permission denied: no further information; nested exception is java.net.SocketException: Permission denied: no further information
Comment From: ryanjbaxter
Do you have spring security enabled for that endpoint on the config server?
Comment From: AnthonyCavanagh
No I dont, this is my application.yml file for the config server, I am using S3 as a repo
Comment From: ryanjbaxter
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
Comment From: AnthonyCavanagh
Ok I will try and sort that out, but can you tell me what the exception is saying. Why its not allowing me to connect. Especailly since its the correct URL.
Comment From: ryanjbaxter
Permission denied makes me think it's a security issue, hence why I am asking about spring security
Comment From: AnthonyCavanagh
But I dont have spring security set.
Comment From: ryanjbaxter
It just needs to be on the class path. If it's not then I am not sure, hence why I am asking for a sample to reproduce so I can take a look
Comment From: AnthonyCavanagh
hp-fetcher-htmlunit.zip The client
Comment From: ryanjbaxter
I need the server too
Comment From: AnthonyCavanagh
Comment From: AnthonyCavanagh
Comment From: AnthonyCavanagh
Its when I try to use the ServiceId that it gets connection refused
Comment From: ryanjbaxter
Is that the right ip and port for the config server? If you use the same ip and port and don't use discovery first configuration does it work?
Comment From: AnthonyCavanagh
Not sure what you mean in my eureka disvovery its This works : cloud: config: enabled: true uri: http://localhost:8086
HP-FETCHER-CONFIG-SERVICE | n/a (1) | (1) | UP (1) - 192.168.0.19:hp-fetcher-config-service:8086
cloud: config: enabled: true #uri: http://localhost:8086 discovery: enabled: true serviceId: HP-FETCHER-CONFIG-SERVICE The exception states
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8888/hp-fetcher-htmlunit/local": Connection refused: no further.
I have no idea why its ignoring the service Id and defaulting to ttp://localhost:8888/hp-fetcher-htmlunit/local.
Comment From: AnthonyCavanagh
I bet there is another property I have to set that says use the Service Id
Comment From: ryanjbaxter
Something with the discovery first configuration is not right, localhost:8888 is what the client defaults to when a uri is not specified or the discovery server is not being used.
Comment From: AnthonyCavanagh
Is the problem with the discovery service or the client. Does Eureka server need a property to say that the spring cloud config server will be using it
Comment From: AnthonyCavanagh
I think this is the problem
spring.config.import=configserver I just copied this. is it supposed to be config server , or the name of my config server application
Comment From: ryanjbaxter
See the warning at the top of this section https://docs.spring.io/spring-cloud-config/docs/3.0.5/reference/html/#discovery-first-bootstrap
Comment From: AnthonyCavanagh
Found the problem or a problem. I am using awss3 and according to the documentation I need to set it as awss3 So in my config server application.yml I set awss3,
So this works spring: profiles: active: awss3 application: name: HP-FETCHER-CONFIG-SERVICE cloud: config: server: awss3: bucket: hp-fetcher-config region: us-west-2 order: 1
But I need to have two profiles awss3,local, or awss3,dev or awss3, qa, or awss3, prod
So when I have spring: profiles: active: awss3, local.
My client cant find the config service , I have no idea why this happening, since with or without
Comment From: AnthonyCavanagh
Found the issue, can we close this issue and open a new one