Closed gariem closed 8 years ago
What is this hosts ?
OUT Caused by: java.net.UnknownHostException: 81jpqh7q4l1 ?
PLease share your application's bootstrap yml configuration also.
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:
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
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
Seems issue with your app now, server is returning 403 http error code. Please check.
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? :)
Yes, my bad. I will again look at the log and update it.
if you click on eureka service node name what port does it shows ?
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?
Is it possible to provide a sample app to debug issue?
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.
Have you solved your problem? If so , could you please provide and example of how you solved the problem? Thank you.
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.
Oh! Sorry, but It is quite urgent for me to solve this problem. Thank you.
@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
@raphsoft sorry I closed it by mistake. I can't see anything wrong with your config though. Are you on the latest snapshots?
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):
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.
Please read the section of the user guide I linked to above. Here's what it says:
The Spring Cloud
DiscoveryClient
will always return anhttps://...
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?
Thanks a lot, I've added the missing configuration and was able to get everything working fine.
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
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 :
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.