Spring Cloud service Look up error: Load balancer does not have available server for client

I’ve been playing with a Spring Cloud app consisting of a config server, a discovery server (Eureka) and a Feign client with Ribbon (internally used by Feign). I’ve 2 services, a movie-service and a daily-update-service. The intent is to provide a daily update of popular movies, news and weather in one place.
Problem I’m having is that the movie-service Feign client is not able to find it from daily-update-service. It errors out with the following:

Caused by: java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: movie-service
daily_update_service_1 |    at org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:59) ~[spring-cloud-netflix-core-1.1.0.M4.jar:1.1.0.M4]
daily_update_service_1 |    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:95) ~[feign-core-8.12.1.jar:8.12.1]
daily_update_service_1 |    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:74) ~[feign-core-8.12.1.jar:8.12.1]
daily_update_service_1 |    at feign.hystrix.HystrixInvocationHandler$1.run(HystrixInvocationHandler.java:54) ~[feign-hystrix-8.12.1.jar:8.12.1]
daily_update_service_1 |    at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:294) ~[hystrix-core-1.4.21.jar:1.4.21]
daily_update_service_1 |    ... 21 common frames omitted
daily_update_service_1 | Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: movie-service
daily_update_service_1 |    at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:468) ~[ribbon-loadbalancer-2.1.0.jar:2.1.0]
daily_update_service_1 |    at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.1.0.jar:2.1.0]
daily_update_service_1 |    at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.1.0.jar:2.1.0]

My debugging so far shows that the DomainExtractingServerList is trying to do a look up by VIP, which’s movie-service and coming up with no servers. The services are registered in Eureka and I can see them on the Eureka dashboard.

  • Limit the number of exited containers on a host (1.8.3)
  • Why does bash script work depend on the size of the terminal window?
  • Restore mongodb dump from a folder using Docker in ubuntu
  • How can I run Lektor within a Docker container?
  • Is it a good practice to have an extra docker container for build tasks?
  • What are the correct Permissions for docker in docker as another user?
  • I’m not sure what pieces of the code are relevant so I’m posting a link to the Github project. Assuming you’ve Docker and Docker Compose installed, the easiest way to get it up and running is to clone the project and then follow the following instructions. These instructions are for a Mac/Linux OS, adapt them if necessary to Windows. I’ll provide specific code snippets if someone wants to see it here instead of looking in the code.

    1. cd daily-update-microservices.
    2. Replace all occurences of my docker host IP with yours. You can use this command: grep -rl '192.168.99.107' . | xargs perl -pi -e "s/192\.168\.99\.107/$(echo $DOCKER_HOST | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}')/"
    3. Run ./gradlew clean buildDockerImage
    4. Run docker-compose -f daily-update-service/docker-compose.yml up.
    5. Once the services come up, do a curl -v http://$(echo $DOCKER_HOST | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}'):10000/dailyupdate/movies/popular

  • Docker volume on external hard drive
  • How to have “RUN” command in docker-compose similar to dockerfile?
  • php significant slower on docker then kvm
  • Ansible: no package available for docker-ce
  • bundler: command not found: rails with docker-compose on a sample project
  • How to cache package manager downloads for docker builds?
  • One Solution collect form web for “Spring Cloud service Look up error: Load balancer does not have available server for client”

    Upon further investigation, I found that if eureka.client.fetchRegistry is false, the various shuffle methods in com.netflix.discovery.shared.Applications are not called and hence Applications.shuffleVirtualHostNameMap is never populated. This map is used later for look up in the method Applications.getInstancesByVirtualHostName that then fails.

    I don’t understand why a client would be forced to download the registry. They may choose to make the network trip each time or get delta when necessary.

    I’ve opened an issue on Github for this. Will wait for their response.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.