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

Zuul Proxy in Cloud Foundry not working #761

Closed gariem closed 8 years ago

gariem commented 8 years ago

I have the following scenario in Cloud Foundry:

When I run all the components in my local machine, the "cache" application gets registered in Eureka and Zuul automatically creates a route for /cache/**. Therefore I'm able to send a request to http://localhost:8765/cache/items/ and receive the response data from the actual "cache" application, as the request is successfully forwarded by zuul.

However, I'm not able to find the correct configuration for Zuul and/or the "cache" application in Cloud Foundry.

As you may know, CF has a global proxy so every instance of an application shares the same URL. Additionally, in my case, I access all the services though HTTPS (and I'm not allowed to use non-secured HTTP).

Here's my application.yml for the "cache" application :

eureka:
  instance:
    leaseRenewalIntervalInSeconds: 10
    metadataMap:
      instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${server.port}}}
    status-page-url-path: ${management.context-path}/info
    health-check-url-path: ${management.context-path}/health
    securePortEnabled: true
    nonSecurePortEnabled: false
  client:
    serviceUrl:
      defaultZone: https://service-registry.cfappsz1.mycompany.com/eureka/
    region: default
    registryFetchIntervalSeconds: 5
    availabilityZones:
      default: ${APPLICATION_DOMAIN:${DOMAIN:defaultZone}}

So, in CF, when I start my application called "customer" it actually gets registered in Eureka and Zuul creates a route for /cache/\ ...but when I request https://zuul-proxy.cfappsz1.mycompany.com/cache/** I get the following error:

I will really appreciate any suggestion.

19:04:26 [APP] OUT 2016-01-08 19:04:26.368 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - Re-registering apps/ZUUL
19:04:26 [APP] OUT 2016-01-08 19:04:26.368 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f: registering service...
19:04:26 [APP] OUT 2016-01-08 19:04:26.505 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - registration status: 204
19:04:36 [APP] OUT 2016-01-08 19:04:36.634 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - Re-registering apps/ZUUL
19:04:36 [APP] OUT 2016-01-08 19:04:36.635 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f: registering service...
19:04:36 [APP] OUT 2016-01-08 19:04:36.764 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - registration status: 204
19:04:46 [APP] OUT 2016-01-08 19:04:46.901 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - Re-registering apps/ZUUL
19:04:46 [APP] OUT 2016-01-08 19:04:46.902 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f: registering service...
19:04:47 [APP] OUT 2016-01-08 19:04:47.037 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - registration status: 204
19:04:48 [APP] OUT 2016-01-08 19:04:48.762 INFO 22 --- [nio-8080-exec-1] o.s.c.n.zuul.filters.ProxyRouteLocator : Finding route for path: /cache/lookup/domainType
19:04:49 [APP] OUT com.netflix.zuul.exception.ZuulException: Forwarding error
19:04:49 [APP] OUT 2016-01-08 19:04:49.208 WARN 22 --- [nio-8080-exec-1] o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering
19:04:49 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:141)
19:04:49 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:105)
19:04:49 [APP] OUT at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112)
19:04:49 [APP] OUT at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:197)
19:04:49 [APP] OUT at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:161)
19:04:49 [APP] OUT at com.netflix.zuul.FilterProcessor.route(FilterProcessor.java:120)
19:04:49 [APP] OUT at com.netflix.zuul.ZuulRunner.route(ZuulRunner.java:84)
19:04:49 [APP] OUT at com.netflix.zuul.http.ZuulServlet.route(ZuulServlet.java:111)
19:04:49 [APP] OUT at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:77)
19:04:49 [APP] OUT at org.springframework.cloud.netflix.zuul.web.ZuulController.handleRequestInternal(ZuulController.java:43)
19:04:49 [APP] OUT at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:146)
19:04:49 [APP] OUT at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)
19:04:49 [APP] OUT at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
19:04:49 [APP] OUT at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
19:04:49 [APP] OUT at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
19:04:49 [APP] OUT at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
19:04:49 [APP] OUT at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
19:04:49 [APP] OUT at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
19:04:49 [APP] OUT at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
19:04:49 [APP] OUT at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:04:49 [APP] OUT at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:04:49 [APP] OUT at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:295)
19:04:49 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
19:04:49 [APP] OUT at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:102)
19:04:49 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:04:49 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:04:49 [APP] OUT at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
19:04:49 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
19:04:49 [RTR] OUT zuul-proxy.cfappsz1.mycompany.com - [09/01/2016:00:04:48 +0000] "GET /cache/lookup/domainType HTTP/1.1" 200 0 314 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36" 10.73.217.10:54876 x_forwarded_for:"70.105.109.122" x_forwarded_proto:"https" vcap_request_id:977625f1-0ef8-4d7c-424a-2bf0d010c75e response_time:0.460947404 app_id:5fc7ea89-2240-452c-9d30-73d43f13e477 
19:04:49 [APP] OUT at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:04:49 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
19:04:49 [APP] OUT at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
19:04:49 [APP] OUT at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
19:04:49 [APP] OUT at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
19:04:49 [APP] OUT at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
19:04:49 [APP] OUT at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
19:04:49 [APP] OUT at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
19:04:49 [APP] OUT at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:69)
19:04:49 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
19:04:49 [APP] OUT at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
19:04:49 [APP] OUT at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
19:04:49 [APP] OUT at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
19:04:49 [APP] OUT at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
19:04:49 [APP] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
19:04:49 [APP] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
19:04:49 [APP] OUT at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
19:04:49 [APP] OUT at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
19:04:49 [APP] OUT at java.lang.Thread.run(Thread.java:745)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:794)
19:04:49 [APP] OUT Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: cacheRibbonCommand failed and no fallback available.
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:807)
19:04:49 [APP] OUT at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:77)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$DeprecatedOnFallbackHookApplication$1.onError(AbstractCommand.java:1516)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$FallbackHookApplication$1.onError(AbstractCommand.java:1406)
19:04:49 [APP] OUT at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:314)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:306)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:78)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$3.onError(AbstractCommand.java:1007)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:297)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$DeprecatedOnRunHookApplication$1.onError(AbstractCommand.java:1475)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$ExecutionHookApplication$1.onError(AbstractCommand.java:1371)
19:04:49 [APP] OUT at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:289)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$1.call(AbstractCommand.java:398)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$ObservableCommand$1.call(AbstractCommand.java:1135)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.internal.operators.BlockingOperatorToFuture.toFuture(BlockingOperatorToFuture.java:57)
19:04:49 [APP] OUT at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:335)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$1.call(AbstractCommand.java:377)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
19:04:49 [APP] OUT at com.netflix.hystrix.AbstractCommand$ObservableCommand$1.call(AbstractCommand.java:1131)
19:04:49 [APP] OUT at rx.Observable.subscribe(Observable.java:7621)
19:04:49 [APP] OUT at rx.observables.BlockingObservable.toFuture(BlockingObservable.java:410)
19:04:49 [APP] OUT at com.netflix.hystrix.HystrixCommand.queue(HystrixCommand.java:379)
19:04:49 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:125)
19:04:49 [APP] OUT ... 59 common frames omitted
19:04:49 [APP] OUT Caused by: com.netflix.client.ClientException: Number of retries on next server exceeded max 1 retries, while making a call for: 2ebfb971-05fe-483a-4578-f097c26b134b
19:04:49 [APP] OUT at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:77)
19:04:49 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$4.call(LoadBalancerCommand.java:350)
19:04:49 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$4.call(LoadBalancerCommand.java:345)
19:04:49 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber$1$1.onError(OperatorRetryWithPredicate.java:105)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onError(OperatorConcat.java:148)
19:04:49 [APP] OUT at rx.observers.SerializedObserver.onError(SerializedObserver.java:122)
19:04:49 [APP] OUT at rx.observers.SerializedSubscriber.onError(SerializedSubscriber.java:79)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatInnerSubscriber.onError(OperatorConcat.java:218)
19:04:49 [APP] OUT at rx.observers.SerializedObserver.onError(SerializedObserver.java:122)
19:04:49 [APP] OUT at rx.observers.SerializedSubscriber.onError(SerializedSubscriber.java:79)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onError(OperatorConcat.java:148)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatInnerSubscriber.onError(OperatorConcat.java:218)
19:04:49 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
19:04:49 [APP] OUT at rx.Observable$ThrowObservable$1.call(Observable.java:9415)
19:04:49 [APP] OUT at rx.Observable$ThrowObservable$1.call(Observable.java:9405)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:142)
19:04:49 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:32)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.subscribeNext(OperatorConcat.java:177)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:78)
19:04:49 [APP] OUT at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
19:04:49 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:43)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.subscribeNext(OperatorConcat.java:177)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:142)
19:04:49 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:78)
19:04:49 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
19:04:49 [APP] OUT at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
19:04:49 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:185)
19:04:49 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
19:04:49 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber$1.call(OperatorRetryWithPredicate.java:120)
19:04:49 [APP] OUT at rx.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.enqueue(TrampolineScheduler.java:80)
19:04:49 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:77)
19:04:49 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:45)
19:04:49 [APP] OUT at rx.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.schedule(TrampolineScheduler.java:59)
19:04:49 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:43)
19:04:49 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:32)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:144)
19:04:49 [APP] OUT at rx.Observable$1.call(Observable.java:136)
19:04:49 [APP] OUT at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:442)
19:04:49 [APP] OUT at rx.Observable.subscribe(Observable.java:7621)
19:04:49 [APP] OUT at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
19:04:49 [APP] OUT at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:102)
19:04:49 [APP] OUT at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:81)
19:04:49 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonCommand.forward(RibbonCommand.java:132)
19:04:49 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonCommand.run(RibbonCommand.java:106)
19:04:49 [APP] OUT ... 104 common frames omitted
19:04:49 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonCommand.run(RibbonCommand.java:50)
19:04:49 [APP] OUT at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:294)
19:04:49 [APP] OUT Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.UnknownHostException: 81jpqh7q4l1
19:04:49 [APP] OUT at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
19:04:49 [APP] OUT at com.sun.jersey.api.client.Client.handle(Client.java:648)
19:04:49 [APP] OUT at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
19:04:49 [APP] OUT at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
19:04:49 [APP] OUT at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
19:04:49 [APP] OUT at com.netflix.niws.client.http.RestClient.execute(RestClient.java:618)
19:04:49 [APP] OUT at com.netflix.niws.client.http.RestClient.execute(RestClient.java:527)
19:04:49 [APP] OUT at com.netflix.niws.client.http.RestClient.execute(RestClient.java:92)
19:04:49 [APP] OUT at com.netflix.client.AbstractLoadBalancerAwareClient$1.call(AbstractLoadBalancerAwareClient.java:109)
19:04:49 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$3$1.call(LoadBalancerCommand.java:287)
19:04:49 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$3$1.call(LoadBalancerCommand.java:303)
19:04:49 [APP] OUT ... 145 common frames omitted
19:04:49 [APP] OUT Caused by: java.net.UnknownHostException: 81jpqh7q4l1
19:04:49 [APP] OUT at java.net.InetAddress.getAllByName(InetAddress.java:1126)
19:04:49 [APP] OUT at java.net.InetAddress.getAllByName0(InetAddress.java:1280)
19:04:49 [APP] OUT at java.net.InetAddress.getAllByName(InetAddress.java:1192)
19:04:49 [APP] OUT at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:259)
19:04:49 [APP] OUT at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
19:04:49 [APP] OUT at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131)
19:04:49 [APP] OUT at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
19:04:49 [APP] OUT at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
19:04:49 [APP] OUT at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115)
19:04:49 [APP] OUT ... 155 common frames omitted
19:04:49 [APP] OUT at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44)
19:04:49 [APP] OUT at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:159)
19:04:49 [APP] OUT at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
19:04:49 [APP] OUT at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
19:04:49 [APP] OUT at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170)
19:04:54 [HEALTH] OUT healthcheck passed
19:04:54 [HEALTH] OUT Exit status 0
19:04:57 [APP] OUT 2016-01-08 19:04:57.179 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - Re-registering apps/ZUUL
19:04:57 [APP] OUT 2016-01-08 19:04:57.179 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f: registering service...
19:04:57 [APP] OUT 2016-01-08 19:04:57.320 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - registration status: 204
19:05:07 [APP] OUT 2016-01-08 19:05:07.872 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - Re-registering apps/ZUUL
19:05:07 [APP] OUT 2016-01-08 19:05:07.872 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f: registering service...
19:05:08 [APP] OUT 2016-01-08 19:05:08.015 INFO 22 --- [pool-4-thread-1] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ZUUL/81jnuihknqs:60a6344b-9dd8-4419-5eaf-16dca465385f - registration status: 204
pradeepsingh1234 commented 8 years ago

What is this hosts ?

OUT Caused by: java.net.UnknownHostException: 81jpqh7q4l1 ?

PLease share your application's bootstrap yml configuration also.

gariem commented 8 years ago

That's a good question, I don't know where that hostname comes from. Initially I though it was the vcap.application.instance_id but it isn't.

It seems to be the hostname returned by java.net.InetAddress because it is actually the value that gets registered with Eureka:

image

This is what the bootstrap.yml file for my cache application contains:

spring:
  profiles:
    active: integration
  application:
    name: cache
  cloud:
    config:
      uri: http://config-server.cfappsz1.mycompany.com

The config-server is backed by a git config-repo, this is its content for the integration profile:

spring:
  profiles: integration

eureka:
  instance:
    leaseRenewalIntervalInSeconds: 10
    metadataMap:
      instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${server.port}}}
    status-page-url-path: ${management.context-path}/info
    health-check-url-path: ${management.context-path}/health
    securePortEnabled: true
    nonSecurePortEnabled: false
  client:
    serviceUrl:
      defaultZone: https://service-registry.cfappsz1.mycompany.com/eureka/
    region: default
    registryFetchIntervalSeconds: 5
    availabilityZones:
      default: ${APPLICATION_DOMAIN:${DOMAIN:defaultZone}}

Additionally, application.yml also contains:

server:
  port: ${PORT:8082}
  tomcat:
    remote_ip_header: x-forwarded-for
    protocol_header: x-forwarded-proto

management:
  context-path: /admin

spring:
  application:
    name: cache
  profiles:
    active: integration

endpoints:
  restart:
    enabled: true

logging:
  levels:
    org.springframework.boot.env.PropertySourcesLoader: INFO
    org.springframework.web: INFO

However, if I add ${vcap.application.uris[0]} as value for the eureka.instance.hostname property to the applications configuration, I can see a better looking hostname registered in Eureka, but I still get this error: org.apache.http.NoHttpResponseException: cache-services.cfappsz1.mycompany.com:443 failed to respond

image

11:15:09 [APP] OUT 2016-01-11 11:15:09.878 INFO 22 --- [nio-8080-exec-8] o.s.c.n.zuul.filters.ProxyRouteLocator : Finding route for path: /cache/lookup/domainType
11:15:10 [APP] OUT 2016-01-11 11:15:10.532 WARN 22 --- [nio-8080-exec-8] o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering
11:15:10 [APP] OUT at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112)
11:15:10 [APP] OUT at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:197)
11:15:10 [APP] OUT at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:161)
11:15:10 [APP] OUT com.netflix.zuul.exception.ZuulException: Forwarding error
11:15:10 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:141)
11:15:10 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:105)
11:15:10 [APP] OUT at com.netflix.zuul.FilterProcessor.route(FilterProcessor.java:120)
11:15:10 [APP] OUT at com.netflix.zuul.ZuulRunner.route(ZuulRunner.java:84)
11:15:10 [APP] OUT at com.netflix.zuul.http.ZuulServlet.route(ZuulServlet.java:111)
11:15:10 [APP] OUT at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:77)
11:15:10 [APP] OUT at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)
11:15:10 [APP] OUT at org.springframework.cloud.netflix.zuul.web.ZuulController.handleRequestInternal(ZuulController.java:43)
11:15:10 [APP] OUT at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:146)
11:15:10 [APP] OUT at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
11:15:10 [APP] OUT at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
11:15:10 [APP] OUT at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
11:15:10 [APP] OUT at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
11:15:10 [APP] OUT at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
11:15:10 [APP] OUT at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
11:15:10 [APP] OUT at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
11:15:10 [APP] OUT at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:15:10 [APP] OUT at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:15:10 [APP] OUT at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:295)
11:15:10 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:15:10 [APP] OUT at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:102)
11:15:10 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:15:10 [APP] OUT at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:15:10 [RTR] OUT zuul-proxy.cfappsz1.mycompany.com - [11/01/2016:16:15:09 +0000] "GET /cache/lookup/domainType HTTP/1.1" 200 0 314 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36" 10.73.217.10:50948 x_forwarded_for:"70.105.109.122" x_forwarded_proto:"https" vcap_request_id:91a6c5fb-890d-4efe-715c-dc606e372dcc response_time:0.684110702 app_id:5fc7ea89-2240-452c-9d30-73d43f13e477 
11:15:10 [APP] OUT at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
11:15:10 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
11:15:10 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
11:15:10 [APP] OUT at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
11:15:10 [APP] OUT at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
11:15:10 [APP] OUT at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
11:15:10 [APP] OUT at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
11:15:10 [APP] OUT at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
11:15:10 [APP] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
11:15:10 [APP] OUT at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
11:15:10 [APP] OUT at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:69)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:15:10 [APP] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:15:10 [APP] OUT at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
11:15:10 [APP] OUT at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
11:15:10 [APP] OUT at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
11:15:10 [APP] OUT at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
11:15:10 [APP] OUT at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
11:15:10 [APP] OUT at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:794)
11:15:10 [APP] OUT at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:314)
11:15:10 [APP] OUT at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:77)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$DeprecatedOnFallbackHookApplication$1.onError(AbstractCommand.java:1516)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$FallbackHookApplication$1.onError(AbstractCommand.java:1406)
11:15:10 [APP] OUT at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:306)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
11:15:10 [APP] OUT at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:78)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$DeprecatedOnRunHookApplication$1.onError(AbstractCommand.java:1475)
11:15:10 [APP] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
11:15:10 [APP] OUT at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at java.lang.Thread.run(Thread.java:745)
11:15:10 [APP] OUT Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: cacheRibbonCommand failed and no fallback available.
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:807)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$1.call(AbstractCommand.java:398)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$1.call(AbstractCommand.java:377)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$ObservableCommand$1.call(AbstractCommand.java:1131)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable.subscribe(Observable.java:7621)
11:15:10 [APP] OUT at rx.internal.operators.BlockingOperatorToFuture.toFuture(BlockingOperatorToFuture.java:57)
11:15:10 [APP] OUT at rx.observables.BlockingObservable.toFuture(BlockingObservable.java:410)
11:15:10 [APP] OUT at com.netflix.hystrix.HystrixCommand.queue(HystrixCommand.java:379)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$ExecutionHookApplication$1.onError(AbstractCommand.java:1371)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$3.onError(AbstractCommand.java:1007)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:297)
11:15:10 [APP] OUT at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:289)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at com.netflix.hystrix.AbstractCommand$ObservableCommand$1.call(AbstractCommand.java:1135)
11:15:10 [APP] OUT at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:335)
11:15:10 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:125)
11:15:10 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$4.call(LoadBalancerCommand.java:345)
11:15:10 [APP] OUT at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:77)
11:15:10 [APP] OUT ... 59 common frames omitted
11:15:10 [APP] OUT Caused by: com.netflix.client.ClientException: Number of retries on next server exceeded max 1 retries, while making a call for: 4164c425-d63d-4f2a-5613-3097080aaaf8
11:15:10 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$4.call(LoadBalancerCommand.java:350)
11:15:10 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber$1$1.onError(OperatorRetryWithPredicate.java:105)
11:15:10 [APP] OUT at rx.observers.SerializedSubscriber.onError(SerializedSubscriber.java:79)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatInnerSubscriber.onError(OperatorConcat.java:218)
11:15:10 [APP] OUT at rx.observers.SerializedObserver.onError(SerializedObserver.java:122)
11:15:10 [APP] OUT at rx.observers.SerializedSubscriber.onError(SerializedSubscriber.java:79)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatInnerSubscriber.onError(OperatorConcat.java:218)
11:15:10 [APP] OUT at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70)
11:15:10 [APP] OUT at rx.Observable$ThrowObservable$1.call(Observable.java:9415)
11:15:10 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.subscribeNext(OperatorConcat.java:177)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:78)
11:15:10 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:43)
11:15:10 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:32)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.observers.SerializedObserver.onError(SerializedObserver.java:122)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onError(OperatorConcat.java:148)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onError(OperatorConcat.java:148)
11:15:10 [APP] OUT at rx.Observable$ThrowObservable$1.call(Observable.java:9405)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:142)
11:15:10 [APP] OUT at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.subscribeNext(OperatorConcat.java:177)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:142)
11:15:10 [APP] OUT at rx.internal.operators.OperatorConcat$ConcatSubscriber.onNext(OperatorConcat.java:78)
11:15:10 [APP] OUT at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
11:15:10 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:185)
11:15:10 [APP] OUT at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable.unsafeSubscribe(Observable.java:7531)
11:15:10 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber$1.call(OperatorRetryWithPredicate.java:120)
11:15:10 [APP] OUT at rx.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.enqueue(TrampolineScheduler.java:80)
11:15:10 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:77)
11:15:10 [APP] OUT at rx.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.schedule(TrampolineScheduler.java:59)
11:15:10 [APP] OUT at rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber.onNext(OperatorRetryWithPredicate.java:45)
11:15:10 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:43)
11:15:10 [APP] OUT at rx.internal.util.ScalarSynchronousObservable$1.call(ScalarSynchronousObservable.java:32)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:144)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.Observable.subscribe(Observable.java:7621)
11:15:10 [APP] OUT at rx.Observable$1.call(Observable.java:136)
11:15:10 [APP] OUT at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:442)
11:15:10 [APP] OUT at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
11:15:10 [APP] OUT at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:102)
11:15:10 [APP] OUT at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:81)
11:15:10 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonCommand.forward(RibbonCommand.java:132)
11:15:10 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonCommand.run(RibbonCommand.java:106)
11:15:10 [APP] OUT at org.springframework.cloud.netflix.zuul.filters.route.RibbonCommand.run(RibbonCommand.java:50)
11:15:10 [APP] OUT at com.netflix.hystrix.HystrixCommand$1.call(HystrixCommand.java:294)
11:15:10 [APP] OUT Caused by: com.sun.jersey.api.client.ClientHandlerException: org.apache.http.NoHttpResponseException: cache-services.cfappsz1.mycompany.com:443 failed to respond
11:15:10 [APP] OUT ... 104 common frames omitted
11:15:10 [APP] OUT at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184)
11:15:10 [APP] OUT at com.sun.jersey.api.client.Client.handle(Client.java:648)
11:15:10 [APP] OUT at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
11:15:10 [APP] OUT at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
11:15:10 [APP] OUT at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
11:15:10 [APP] OUT at com.netflix.niws.client.http.RestClient.execute(RestClient.java:92)
11:15:10 [APP] OUT at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283)
11:15:10 [APP] OUT at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
11:15:10 [RTR] OUT zuul-proxy.cfappsz1.mycompany.com - [11/01/2016:16:15:10 +0000] "GET /favicon.ico HTTP/1.1" 200 0 946 "https://zuul-proxy.cfappsz1.mycompany.com/cache/lookup/domainType" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36" 10.73.217.10:50948 x_forwarded_for:"70.105.109.122" x_forwarded_proto:"https" vcap_request_id:718a3f52-4e68-45ae-78e5-56c8f337c849 response_time:0.029035261 app_id:5fc7ea89-2240-452c-9d30-73d43f13e477 
pradeepsingh1234 commented 8 years ago

Seems issue with your app now, server is returning 403 http error code. Please check.

gariem commented 8 years ago

I don't see any 403 / Forbidden reponse in the logs. Also, I get a valid response when I do request directly to the cache service deployed in cf. Maybe you confused the 443 (secure port) with 403 error? :)

pradeepsingh1234 commented 8 years ago

Yes, my bad. I will again look at the log and update it.

pradeepsingh1234 commented 8 years ago

if you click on eureka service node name what port does it shows ?

gariem commented 8 years ago

It shows 8080, which is the port assigned by Cloud Foundry to the $PORT variable, however it should be 443 as it is the port used to access the application through the CF Global Proxy.

I tried setting securePortEnabled: true and nonSecurePortEnabled: false with no luck. Also set remote_ip_header: x-forwarded-for and protocol_header: x-forwarded-proto

The configurarion I used for Eureka instance is as above. Do you have any idea?

pradeepsingh1234 commented 8 years ago

Is it possible to provide a sample app to debug issue?

dsyer commented 8 years ago

From the user guide (http://projects.spring.io/spring-cloud/spring-cloud.html#_registering_a_secure_application):

Because of the way Eureka works internally, it will still publish a non-secure URL for status and home page unless you also override those explicitly.

EriksonMurrugarra2017 commented 8 years ago

Have you solved your problem? If so , could you please provide and example of how you solved the problem? Thank you.

dsyer commented 8 years ago

Thanks for asking here, but I notice you've also posted the same question on Stack Overflow, where I have answered your question, and you sent me a personal email. It's better if in the future you don't cross-post questions as it makes it hard for people searching to find answers. Please go to Stack Overflow for general usage questions.

EriksonMurrugarra2017 commented 8 years ago

Oh! Sorry, but It is quite urgent for me to solve this problem. Thank you.

gariem commented 8 years ago

@dsyer as you can see above, I actually set the value for eureka.instance.securePortEnabled to true and the eureka.instance.nonSecurePortEnabled to false, I also set server.tomcat.remote_ip_header= x-forwarded-for and server.tomcat.protocol_header= x-forwarded-proto. Said that, I don't think this issue should be closed.

PD: @pradeepsingh1234 I was not able to provide a sample code but I will do it by tomorrow

dsyer commented 8 years ago

@raphsoft sorry I closed it by mistake. I can't see anything wrong with your config though. Are you on the latest snapshots?

gariem commented 8 years ago

Sorry for delaying my response this long. Here's a code sample of the Eureka Client Application https://github.com/raphsoft/test-apps/tree/master/eureka-zuul-test Whit this configuration the application is actually registered in eureka, however, the port I see there is 8080 and not 443 (the one CF Global Proxy uses to expose the application):

image

The rest of the history is already known, when I then try the Zuul Server to proxy request to the /testapp path, I get the above errors. So I send this because maybe the cause of the error is in the registration part of the entire process.

dsyer commented 8 years ago

Please read the section of the user guide I linked to above. Here's what it says:

The Spring Cloud DiscoveryClient will always return an https://... URI for a service configured this way, and the Eureka (native) instance information will have a secure health check URL. Because of the way Eureka works internally, it will still publish a non-secure URL for status and home page unless you also override those explicitly.

I.e. you have to set the home page and status URLs explicitly (which you didn't do in your sample app). E.g. eureka.instance.home-page-url=https://${eureka.instance.hostName}/. With Brixton snapshots (newer version of eureka) you can use ${eureka.hostname} which is a native Eureka shortcut for the same thing. In older versions of Brixton it would be ${eurekahostname}.

Can you try configuring your app fully and see if whatever other problems you have are related to that?

gariem commented 8 years ago

Thanks a lot, I've added the missing configuration and was able to get everything working fine.

gariem commented 8 years ago

I'm just adding a comment here to say that in case someone need it, I moved the sample code to his new repo: https://github.com/raphsoft/samples/tree/master/resource-server. I just needed to set the following properties:

    hostname: ${vcap.application.uris[0]}
    home-page-url: https://${eureka.instance.hostName}
    status-page-url: https://${eureka.instance.hostname}${management.context-path}/info
    health-check-url: https://${eureka.instance.hostname}${management.context-path}/health