Home > Software design >  problem with spring boot/microservices and eureka
problem with spring boot/microservices and eureka

Time:12-22

I have 2 spring boot/microservices running in intellij. Both the services starts up with no error. But I get an error if the first microsrovice tries to call a service from the second microservice. Any ideas? The code works fine on a test environment but on my local machine I get the error below. I have no idea where I should start looking for the bug. Both microservices are registered at eureka and status is "UP". If I copy the URL shown in the exception to the browser, I get NO connection timeout. So I think the problem is somewhere in the intellij, but I have no idea where something can "block" my request. I'm using openjdk 8. Any hint would be great, thanks

    Caused by: feign.RetryableException: connect timed out executing GET http://ACCLEuUXkX9NNyu:8180/jaxrs/UserManagement/user/
    at feign.FeignException.errorExecuting(FeignException.java:268)
    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:129)
    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89)
    at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
    at com.sun.proxy.$Proxy168.getBenutzerByName(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at at.acredia.acs.tool.proxy.AcsProxy$TargetCallable.call(AcsProxy.java:68)
    at at.acredia.acs.tool.proxy.ValidationProxy.invoke(ValidationProxy.java:35)
    at at.acredia.acs.tool.proxy.AcsProxyInvocationHandler.invoke(AcsProxyInvocationHandler.java:47)
    at com.sun.proxy.$Proxy168.getBenutzerByName(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at at.acredia.acs.tool.proxy.AcsProxy$TargetCallable.call(AcsProxy.java:68)
    at at.acredia.acs.tool.threadLocal.tool.AcsExecutableWrapperUtil.lambda$wrapCallable$1(AcsExecutableWrapperUtil.java:35)
    at at.acredia.acs.tool.hystrix.AcsCallHystrixCommand.run(AcsCallHystrixCommand.java:55)
    at at.acredia.acs.tool.hystrix.AcsCallHystrixCommand.run(AcsCallHystrixCommand.java:19)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
    at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.subscribe(Observable.java:10423)
    at rx.Observable.subscribe(Observable.java:10390)
    at rx.internal.operators.BlockingOperatorToFuture.toFuture(BlockingOperatorToFuture.java:51)
    at rx.observables.BlockingObservable.toFuture(BlockingObservable.java:410)
    at com.netflix.hystrix.HystrixCommand.queue(HystrixCommand.java:378)
    at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:344)
    at at.acredia.acs.tool.hystrix.AcsCallHystrixCommand.executeAndUnwrap(AcsCallHystrixCommand.java:64)
    at at.acredia.acs.tool.hystrix.AcsServerHystrixCommand.run(AcsServerHystrixCommand.java:63)
    at at.acredia.acs.tool.hystrix.AcsServerHystrixCommand.run(AcsServerHystrixCommand.java:22)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
    at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
    at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:56)
    at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:47)
    at feign.opentracing.hystrix.TracingConcurrencyStrategy$OpenTracingHystrixCallable.call(TracingConcurrencyStrategy.java:97)
    at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction.call(HystrixContexSchedulerAction.java:69)
    at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    ... 1 more
Caused by: java.net.SocketTimeoutException: connect timed out
    at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:357)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at feign.Client$Default.convertResponse(Client.java:109)
    at feign.Client$Default.execute(Client.java:105)
    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:119)
    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89)
    at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
    at com.sun.proxy.$Proxy168.getBenutzerByName(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at at.acredia.acs.tool.proxy.AcsProxy$TargetCallable.call(AcsProxy.java:68)
    at at.acredia.acs.tool.proxy.ValidationProxy.invoke(ValidationProxy.java:35)
    at at.acredia.acs.tool.proxy.AcsProxyInvocationHandler.invoke(AcsProxyInvocationHandler.java:47)
    at com.sun.proxy.$Proxy168.getBenutzerByName(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at at.acredia.acs.tool.proxy.AcsProxy$TargetCallable.call(AcsProxy.java:68)
    at at.acredia.acs.tool.threadLocal.tool.AcsExecutableWrapperUtil.lambda$wrapCallable$1(AcsExecutableWrapperUtil.java:35)
    at at.acredia.acs.tool.hystrix.AcsCallHystrixCommand.run(AcsCallHystrixCommand.java:55)
    at at.acredia.acs.tool.hystrix.AcsCallHystrixCommand.run(AcsCallHystrixCommand.java:19)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:86)
    at io.opentracing.rxjava.TracingRxJavaUtils$2$1.call(TracingRxJavaUtils.java:52)
    at rx.Observable.unsafeSubscribe(Observable.java:10327)
    
    

CodePudding user response:

It is hard to say exactly what could be the problem, it would be good if you provided more information about configuration. Since it is a connection timed out error, I would suggest setting timeout on feign in application.properties:

feign.client.config.default.connectTimeout: 160000000

Check out similar question: feign.RetryableException: Read timed out executing GET

CodePudding user response:

found the bug... i had

-Djava.net.preferIPv4Stack=true

at the vm options... without this setting, it worked fine.

  • Related