spring-cloud / spring-cloud-netflix

Integration with Netflix OSS components
http://cloud.spring.io/spring-cloud-netflix/
Apache License 2.0
4.87k stars 2.44k forks source link

Load balancer does not have available server for client #2530

Closed EveT0n closed 6 years ago

EveT0n commented 6 years ago

I’m sure the config about zuul is right。It usually work as expected but sometime the service of route can't work as expected。 the info of logger: 2017-12-08 08:51:31.457 WARN 19231 --- [http-nio-9100-exec-9] o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering com.netflix.zuul.exception.ZuulException: Forwarding error at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.handleException(RibbonRoutingFilter.java:188) ~[spring-cloud-netflix-core-1.3.5.RELEASE.jar:1.3.5.RELEASE] at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:163) ~[spring-cloud-netflix-core-1.3.5.RELEASE.jar:1.3.5.RELEASE] at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:111) ~[spring-cloud-netflix-core-1.3.5.RELEASE.jar:1.3.5.RELEASE] at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112) ~[zuul-core-1.3.0.jar:1.3.0] at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:193) ~[zuul-core-1.3.0.jar:1.3.0] at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:157) ~[zuul-core-1.3.0.jar:1.3.0] at com.netflix.zuul.FilterProcessor.route(FilterProcessor.java:118) ~[zuul-core-1.3.0.jar:1.3.0] at com.netflix.zuul.ZuulRunner.route(ZuulRunner.java:96) ~[zuul-core-1.3.0.jar:1.3.0] at com.netflix.zuul.http.ZuulServlet.route(ZuulServlet.java:116) ~[zuul-core-1.3.0.jar:1.3.0] at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:81) ~[zuul-core-1.3.0.jar:1.3.0] at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:157) [spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.cloud.netflix.zuul.web.ZuulController.handleRequest(ZuulController.java:44) [spring-cloud-netflix-core-1.3.5.RELEASE.jar:1.3.5.RELEASE] at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) [spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) [spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) [spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) [spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.12.RELEASE.jar:4.3.12.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) [spring-boot-1.5.8.RELEASE.jar:1.5.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110) [spring-boot-actuator-1.5.8.RELEASE.jar:1.5.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) [spring-boot-actuator-1.5.8.RELEASE.jar:1.5.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.12.RELEASE.jar:4.3.12.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.23.jar:8.5.23] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.23.jar:8.5.23] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.23.jar:8.5.23] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65] Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: superstore at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:483) ~[ribbon-loadbalancer-2.2.2.jar:2.2.2] at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.2.2.jar:2.2.2] at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.2.2.jar:2.2.2] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber$1.call(OperatorRetryWithPredicate.java:127) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.enqueue(TrampolineScheduler.java:73) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.schedule(TrampolineScheduler.java:52) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:79) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:45) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.util.ScalarSynchronousObservable$WeakSingleProducer.request(ScalarSynchronousObservable.java:276) ~[rxjava-1.1.10.jar:1.1.10] at rx.Subscriber.setProducer(Subscriber.java:209) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:138) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:129) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.subscribe(Observable.java:10307) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.subscribe(Observable.java:10274) ~[rxjava-1.1.10.jar:1.1.10] at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:445) ~[rxjava-1.1.10.jar:1.1.10] at rx.observables.BlockingObservable.single(BlockingObservable.java:342) ~[rxjava-1.1.10.jar:1.1.10] at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:117) ~[ribbon-loadbalancer-2.2.2.jar:2.2.2] at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:105) ~[spring-cloud-netflix-core-1.3.5.RELEASE.jar:1.3.5.RELEASE] at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:43) ~[spring-cloud-netflix-core-1.3.5.RELEASE.jar:1.3.5.RELEASE] at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302) ~[hystrix-core-1.5.12.jar:1.5.12] at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298) ~[hystrix-core-1.5.12.jar:1.5.12] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.subscribe(Observable.java:10307) ~[rxjava-1.1.10.jar:1.1.10] at rx.Observable.subscribe(Observable.java:10274) ~[rxjava-1.1.10.jar:1.1.10] at rx.internal.operators.BlockingOperatorToFuture.toFuture(BlockingOperatorToFuture.java:51) ~[rxjava-1.1.10.jar:1.1.10] at rx.observables.BlockingObservable.toFuture(BlockingObservable.java:412) ~[rxjava-1.1.10.jar:1.1.10] at com.netflix.hystrix.HystrixCommand.queue(HystrixCommand.java:378) ~[hystrix-core-1.5.12.jar:1.5.12] at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:344) ~[hystrix-core-1.5.12.jar:1.5.12] at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:157) ~[spring-cloud-netflix-core-1.3.5.RELEASE.jar:1.3.5.RELEASE] ... 67 common frames omitted

EveT0n commented 6 years ago

maybe it’s too long but i just want describe clearly

ryanjbaxter commented 6 years ago

Please learn how to format code on GitHub.

Basically this means that Ribbon does not have a server for that service name. You will need to provide a sample to reproduce for us to help further.

EveT0n commented 6 years ago

I‘m sorry .I will read the doc . But i'm sure the Ribbon have the server for the service name,because it usually work as expected,this problem usually lasts less than a minute and then returned to normal.

ryanjbaxter commented 6 years ago

How if Ribbon getting the server information? Are you using service discovery or providing a list of servers in your applications configuration?

EveT0n commented 6 years ago

Service discovery.I use Eureka to register service.Zuul is used as a routing.

ryanjbaxter commented 6 years ago

Can you provide the output of http://eurekaserver/eureka/apps?

EveT0n commented 6 years ago

Do you mean the output of eurekaserver,but i don't find any error same time in the output file. It's eurekaserver' output file:

2017-12-08 08:46:57.530  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:47:57.530  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:48:57.531  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:49:49.042  INFO 1940 --- [nio-9002-exec-5] c.n.e.registry.AbstractInstanceRegistry  : Registered instance SUPERSTORE/superstore:10.27.147.13:9004 with status DOWN (replication=false)
2017-12-08 08:49:49.047  INFO 1940 --- [nio-9002-exec-2] c.n.e.registry.AbstractInstanceRegistry  : Cancelled instance SUPERSTORE/superstore:10.27.147.13:9004 (replication=false)
2017-12-08 08:49:49.548  INFO 1940 --- [nio-9002-exec-4] c.n.e.registry.AbstractInstanceRegistry  : Registered instance SUPERSTORE/superstore:10.27.147.13:9004 with status DOWN (replication=true)
2017-12-08 08:49:49.548  INFO 1940 --- [nio-9002-exec-4] c.n.e.registry.AbstractInstanceRegistry  : Cancelled instance SUPERSTORE/superstore:10.27.147.13:9004 (replication=true)
2017-12-08 08:49:57.530  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:50:57.530  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:50:58.915  INFO 1940 --- [io-9002-exec-10] c.n.e.registry.AbstractInstanceRegistry  : Registered instance SUPERSTORE/superstore:10.27.147.13:9004 with status UP (replication=false)
2017-12-08 08:50:59.421  INFO 1940 --- [nio-9002-exec-3] c.n.e.registry.AbstractInstanceRegistry  : Registered instance SUPERSTORE/superstore:10.27.147.13:9004 with status UP (replication=true)
2017-12-08 08:51:57.530  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:52:57.530  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:53:51.993  INFO 1940 --- [hresholdUpdater] c.n.e.r.PeerAwareInstanceRegistryImpl    : Current renewal threshold is : 0
2017-12-08 08:53:57.530  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
2017-12-08 08:54:57.531  INFO 1940 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry  : Running the evict task with compensationTime 0ms
brankoterzic commented 6 years ago

Here is my otput, have the same issue:

applications>
<versions__delta>1</versions__delta>
<apps__hashcode>UP_3_</apps__hashcode>
<application>
<name>ZUUL-SERVICE</name>
<instance>
<instanceId>DESKTOP-LNVJ6QF:zuul-service:8765</instanceId>
<hostName>DESKTOP-LNVJ6QF</hostName>
<app>ZUUL-SERVICE</app>
<ipAddr>10.0.2.15</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8765</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1513164324369</registrationTimestamp>
<lastRenewalTimestamp>1513167233941</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1513164323658</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://DESKTOP-LNVJ6QF:8765/</homePageUrl>
<statusPageUrl>http://DESKTOP-LNVJ6QF:8765/info</statusPageUrl>
<healthCheckUrl>http://DESKTOP-LNVJ6QF:8765/health</healthCheckUrl>
<vipAddress>zuul-service</vipAddress>
<secureVipAddress>zuul-service</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1513164324369</lastUpdatedTimestamp>
<lastDirtyTimestamp>1513164323162</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
<application>
<name>RIBBON-SERVICE</name>
<instance>
<instanceId>DESKTOP-LNVJ6QF:ribbon-service:9000</instanceId>
<hostName>DESKTOP-LNVJ6QF</hostName>
<app>RIBBON-SERVICE</app>
<ipAddr>10.0.2.15</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">9000</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1513166622146</registrationTimestamp>
<lastRenewalTimestamp>1513167252021</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1513166621638</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://DESKTOP-LNVJ6QF:9000/</homePageUrl>
<statusPageUrl>http://DESKTOP-LNVJ6QF:9000/info</statusPageUrl>
<healthCheckUrl>http://DESKTOP-LNVJ6QF:9000/health</healthCheckUrl>
<vipAddress>ribbon-service</vipAddress>
<secureVipAddress>ribbon-service</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1513166622146</lastUpdatedTimestamp>
<lastDirtyTimestamp>1513166621544</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
<application>
<name>USER-SERVICE</name>
<instance>
<instanceId>DESKTOP-LNVJ6QF:user-service:8082</instanceId>
<hostName>DESKTOP-LNVJ6QF</hostName>
<app>USER-SERVICE</app>
<ipAddr>10.0.2.15</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8082</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1513165122646</registrationTimestamp>
<lastRenewalTimestamp>1513167252923</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1513165122136</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://DESKTOP-LNVJ6QF:8082/</homePageUrl>
<statusPageUrl>http://DESKTOP-LNVJ6QF:8082/info</statusPageUrl>
<healthCheckUrl>http://DESKTOP-LNVJ6QF:8082/health</healthCheckUrl>
<vipAddress>user-service</vipAddress>
<secureVipAddress>user-service</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1513165122646</lastUpdatedTimestamp>
<lastDirtyTimestamp>1513164612405</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
</applications>
ryanjbaxter commented 6 years ago

@cndota123 I mean hit the /eureka/apps endpoint on your Eureka server and show me the output. superstore should be there.

EveT0n commented 6 years ago

Yes.The instances currently registered with Eureka of Eureka server website show the superstore is here. So i was so confused why it don't work sometimes.

ryanjbaxter commented 6 years ago

Without more information or some way to reproduce the problem there is not much else we can do.

EveT0n commented 6 years ago

I will try my best to reproduce the problem and check out the code.

vineetsap commented 6 years ago

Is this solved? I am also facing something similar

ryanjbaxter commented 6 years ago

@vineetsap no. We were looking for some way to reproduce this. My gut feeling is that it is environment related.

MrSummer33 commented 6 years ago

@ryanjbaxter I am also facing something similar,I using FEIGN to call The BARRELL server instance that registered with Eureka.while Calling the BARRELL ,there is a error which show me "com.netflix.client.ClientException: Load balancer does not have available server for client: barrell".can you give some advice ? thanks

holy12345 commented 6 years ago

@MrSummer33 Can you provide your project code? Can we reproduce it?

ranjan-das commented 6 years ago

project.zip Hi , I am also facing the same problem. Can you please help me in this? I have attached my project sample code here. Need help urgently on this. Thank you in advance..

cleversonledur commented 6 years ago

I am facing the same problem. Is there any solution?

cleversonledur commented 6 years ago

Im my tests, this occurs when I point the route to the service using serviceId (Eureka)

ranjan-das commented 6 years ago

No , there is no luck yet. Can somebody please help me on this? My sample project details have attached in my initial mail thread

spencergibb commented 6 years ago

@ranjan-das your gateway needs to include the eureka client

<artifactId>spring-cloud-starter-eureka</artifactId>

@cleversonledur can you provide a project that recreates the problem and has proper dependencies?

lishengsam commented 6 years ago

I am also facing the same problem in zuul server about few hours ago in product env . It just accur less than one minute and auto resume. I check the eureka server logs but can't find any relative suspicious infomation.

spring cloud version: Edgware.RELEASE

this is my zuul server application.yaml

spring:
  application:
    name: zuul-server

eureka:
  instance:
    non-secure-port: ${MS_PORT}
    hostname: ${MS_HOST}
  client:
    use-dns-for-fetching-service-urls: true
    eureka-server-d-n-s-name: xxx.ms
    eurekaServerURLContext: eureka
    eureka-server-port: 8761

zuul:
  routes:
    push-token-route:
      path: /xxx/xxx/**
      serviceId : em-push-token
      stripPrefix: false
  ribbon-isolation-strategy: semaphore
  semaphore:
    max-semaphores: 300

hystrix:
  command:
    default:
      execution:
        isolation:
          strategy: SEMAPHORE
          semaphore:
            maxConcurrentRequests: 300
    em-push-token:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 4000

em-push-token:
  ribbon:
    ConnectTimeout: 2000
    ReadTimeout: 3000
ryanjbaxter commented 6 years ago

Folks without someone providing a reproducible set of steps it is going to be hard to help figure out what the problem is. If someone could please give us some steps to reproduce we will gladly look into the problem.

cleversonledur commented 6 years ago

Hi @ryanjbaxter

I created a repository with a simplified version of my current project.

https://github.com/cleversonledur/springcloud-netflixoss-project

cleversonledur commented 6 years ago

@ryanjbaxter I did some updates in the project. There were some problems in docker-compose and hostname addresses. You can run the whole project with ./buildup.sh script.

You can reproduce the error doing an empty request (POST) to http://localhost:8765/test

spencergibb commented 6 years ago

@cleversonledur can you please simplify your project? eureka, gateway and service is all that is needed. It's too much for me to try and dig into.

cleversonledur commented 6 years ago

@spencergibb I removed the project config-server and now we have only eureka, gateway and the microservice projects.

cleversonledur commented 6 years ago

@spencergibb I also simplified the microservice. You can do a simple GET request to /test now.

spencergibb commented 6 years ago

@cleversonledur I created two pull requests that fix your problems.

The gateway wasn't pointed at eureka properly. And microservice, you set the eureka.instance.* settings to the server, which is incorrect.

spencergibb commented 6 years ago

I'm going to close this issue. If anyone can provide a project that is properly configured and shows a bug, I'll reopen.

cleversonledur commented 6 years ago

@spencergibb @ryanjbaxter Thank you very much! Now it is working properly! The problem was my configuration.

rashad-farajullayev commented 6 years ago

@cleversonledur , how did you configure zuul to solve this problem. I am facing the same problem. Would appreciate it a lot if you can share your experience.

EveT0n commented 6 years ago

I think I probably found the problem, dual network card may be the cause of the error。

lishengsam commented 6 years ago

In my situation, ribbon is ok, due to my wrong usage of eureka server.

I had found why I get this error. Because my eureka server sync their instance infos not right that config wrong txt format of dns on aws (each record should split with ' ' but i split with '\n' ). When zuul fetch wrong instance infos from and update local cache, which make this error.

netyjq commented 6 years ago

is anyone solved this problem? sometimes it works, sometimes it goes wrong. the eureka server was run on spring-cloud-netflix, and the client was run on netflix-client-eureka. Here is my code and settings.
eureka-client.properties

# Eureka Server地址
eureka.serviceUrl.default=http://localhost:8761/eureka
# 应用名称
eureka.name=xxservice
# tomcat 端口号
eureka.port=8081

maven dependency

<dependency>
            <groupId>com.netflix.eureka</groupId>
            <artifactId>eureka-client</artifactId>
            <version>1.6.2</version>
        </dependency>

        <dependency>
            <groupId>com.netflix.archaius</groupId>
            <artifactId>archaius-core</artifactId>
            <version>0.7.3</version>
        </dependency>
        <dependency>
            <groupId>org.sonatype.sisu</groupId>
            <artifactId>sisu-guice</artifactId>
            <version>3.2.5</version>
        </dependency>

EurekaClientRegister.java

package com.bozhong;

import com.netflix.appinfo.ApplicationInfoManager;
import com.netflix.appinfo.EurekaInstanceConfig;
import com.netflix.appinfo.InstanceInfo;
import com.netflix.appinfo.providers.EurekaConfigBasedInstanceInfoProvider;
import com.netflix.discovery.DefaultEurekaClientConfig;
import com.netflix.discovery.DiscoveryClient;
import com.netflix.discovery.EurekaClient;
import com.netflix.discovery.EurekaClientConfig;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.net.UnknownHostException;

/**
 * @author yejq@317hu.com
 * @date 2018/6/25
 */
@Component
public class EurekaClientRegister {

    private final static Logger LOG = Logger.getLogger(EurekaClientRegister.class);

    private ApplicationInfoManager applicationInfoManager;
    private EurekaClient eurekaClient;

    @PostConstruct
    public void init() throws UnknownHostException {
        //初始化应用信息管理器,设置其状态为STAERTING
        applicationInfoManager = initializeApplicationInfoManager(new CustomInstanceConfig());
        applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.STARTING);
        LOG.info("Registering service to eureka with STARTING status");

        //读取配置文件,初始化eurekaClient,并设置应用信息管理器的状态为UP
        eurekaClient = initializeEurekaClient(applicationInfoManager, new DefaultEurekaClientConfig());
        applicationInfoManager.setInstanceStatus(InstanceInfo.InstanceStatus.UP);
        LOG.info("Initialization finished, now changing eureka client status to UP");
    }

    @PreDestroy
    public void stop() {
        if (eurekaClient != null) {
            LOG.info("Shutting down eureka service.");
            eurekaClient.shutdown();
        }
    }

    /**
     * 初始化应用信息管理器
     * @param instanceConfig
     * @return
     */
    private synchronized ApplicationInfoManager initializeApplicationInfoManager(EurekaInstanceConfig instanceConfig) throws UnknownHostException {
        if (applicationInfoManager == null) {
            InstanceInfo instanceInfo = new EurekaConfigBasedInstanceInfoProvider(instanceConfig).get();
            applicationInfoManager = new ApplicationInfoManager(instanceConfig, instanceInfo);
        }
        return applicationInfoManager;
    }

    /**
     * 初始化EurekaClient
     * @param applicationInfoManager
     * @param clientConfig
     * @return
     */
    private synchronized EurekaClient initializeEurekaClient(ApplicationInfoManager applicationInfoManager, EurekaClientConfig clientConfig) {
        if (eurekaClient == null) {
            eurekaClient = new DiscoveryClient(applicationInfoManager, clientConfig);
        }
        return eurekaClient;
    }

}

CustomInstanceConfig.java

package com.bozhong;

import com.netflix.appinfo.EurekaInstanceConfig;
import com.netflix.appinfo.MyDataCenterInstanceConfig;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author yejq@317hu.com
 * @date 2018/6/25
 */
public class CustomInstanceConfig extends MyDataCenterInstanceConfig implements EurekaInstanceConfig {

    @Override
    public String getHostName(boolean refresh) {
        try {
            return InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return null;
    }

}
ryanjbaxter commented 6 years ago

Doesnt look like you are using spring cloud

netyjq commented 6 years ago

@ryanjbaxter the eureka server was run on springcloud and the eureka client was an old project run on spring-mvc.

ryanjbaxter commented 6 years ago

If the problem is with the client fetching information from the eureka server and your eureka client is not using spring cloud, than I suggest you ask your question in the Netflix Eureka repo.

robertYang1024 commented 6 years ago
ribbon:
  ReadTimeout: 60000
  ConnectTimeout: 6000
  eureka:
    enabled: true   #important

This solved my problem

brankoterzic commented 6 years ago

@ryanjbaxter @Genitana Did not help. But after get this output on Zuul service everything works again:

2018-07-16 12:55:43.260 INFO 19233 --- [erListUpdater-0] c.netflix.config.ChainedDynamicProperty : Flipping property: ribbon-service.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647

ryanjbaxter commented 6 years ago

Please open a separate issue if you are having a problem.

kishore-diyyana commented 5 years ago

Kishore Babu Diyyana : We can reproduce this issue by giving zuul-route as a placeholder without variable name in ${}.

Below is the example of invalid code, which you can reproduce this error --> com.netflix.client.ClientException: Load balancer does not have available server for client: //localhost:8081/status :

zuul: routes: gatewayTestLocalStatus: url: ${http://localhost:8081/status}


Below is the example of valid code (working code):

zuul: routes: gatewayTestLocalStatus: url: http://localhost:8081/status

OR

zuul: routes: gatewayTestLocalStatus: url: ${SOME_KEY_NAME:http://localhost:8081/status}

So for the Error "com.netflix.client.ClientException: Load balancer does not have available server for client: //localhost:8081/status" the problem is not with anything else, only the problem is the given host/serviceName improperly configured albeit valid host/ServiceName.

Hope this helps :-)