syndesisio / syndesis

This project is archived. A flexible, customizable, open source platform that provides core integration capabilities as a service.
https://syndesis.io/
Apache License 2.0
597 stars 204 forks source link

OpenAPI connector no route to host #4738

Closed mmuzikar closed 5 years ago

mmuzikar commented 5 years ago

This is a...


[ ] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Documentation issue or request

Description

When using the todo json OpenAPI specification with hostname: http://todo-syndesis.my-minishift.syndesis.io/ always results in NoRouteToHost Exception, I've tried reconfiguring the hostname multiple times but nothing seems to be working. In the log included, it seems that there is always : at the end of the URL

2019-03-04 15:40:33.054 DEBUG 1 --- [           main] o.a.camel.spring.boot.RoutesCollector    : CamelContextConfiguration found. Invoking afterApplicationStart: io.syndesis.integration.runtime.sb.jmx.IntegrationMetadataAutoConfiguration$1@6cbcf243
2019-03-04 15:40:33.055 DEBUG 1 --- [           main] o.a.camel.spring.boot.RoutesCollector    : CamelContextConfiguration found. Invoking afterApplicationStart: io.syndesis.integration.runtime.sb.logging.IntegrationLoggingAutoConfiguration$1@339bf286
2019-03-04 15:40:33.130  INFO 1 --- [           main] b.c.e.u.UndertowEmbeddedServletContainer : Undertow started on port(s) 8080 (http)
2019-03-04 15:40:33.135  INFO 1 --- [           main] io.syndesis.example.Application          : Started Application in 8.646 seconds (JVM running for 9.617)
2019-03-04 15:40:35.948  INFO 1 --- [/syndesis-timer] o.apache.http.impl.execchain.RetryExec   : I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://todo-syndesis.my-minishift.syndesis.io:80:  No route to host (Host unreachable)
2019-03-04 15:40:35.949  INFO 1 --- [/syndesis-timer] o.apache.http.impl.execchain.RetryExec   : Retrying request to {}->http://todo-syndesis.my-minishift.syndesis.io:80 
2019-03-04 15:40:38.958  INFO 1 --- [/syndesis-timer] o.apache.http.impl.execchain.RetryExec   : I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://todo-syndesis.my-minishift.syndesis.io:80:  No route to host (Host unreachable)
2019-03-04 15:40:38.958  INFO 1 --- [/syndesis-timer] o.apache.http.impl.execchain.RetryExec   : Retrying request to {}->http://todo-syndesis.my-minishift.syndesis.io:80 
2019-03-04 15:40:41.962  INFO 1 --- [/syndesis-timer] o.apache.http.impl.execchain.RetryExec   : I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://todo-syndesis.my-minishift.syndesis.io:80:  No route to host (Host unreachable)
2019-03-04 15:40:41.962  INFO 1 --- [/syndesis-timer] o.apache.http.impl.execchain.RetryExec   : Retrying request to {}->http://todo-syndesis.my-minishift.syndesis.io:80 
2019-03-04 15:40:44.975 ERROR 1 --- [/syndesis-timer] o.a.camel.processor.DefaultErrorHandler  : Failed delivery for (MessageId: i-L_8MGmN-iESMJwF8mCgz on ExchangeId: i-L_8MGm1-iESMJwF8mCfz). Exhausted after delivery attempt: 1 caught: java.net.NoRouteToHostException: No route to host (Host unreachable)
Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[-L_8M-dKasdV8AaodB] [-L_8M-dKasdV8AaodB] [timer://syndesis-timer?period=60000                                           ] [     12194]
[-L_8M-dKasdV8AaodB] [setHeader1        ] [setHeader[Syndesis.FLOW_ID]                                                   ] [         7]
[-L_8M-dKasdV8AaodB] [setHeader2        ] [setHeader[Syndesis.STEP_ID]                                                   ] [         0]
[-L_8M-dKasdV8AaodB] [process1          ] [Processor@0x6396414a                                                          ] [         0]
[-L_8M-dKasdV8AaodB] [step:-L_8M1Y5asdV8] [pipeline                                                                      ] [         0]
[-L_8M-dKasdV8AaodB] [setHeader3        ] [setHeader[Syndesis.STEP_ID]                                                   ] [         0]
[-L_8M-dKasdV8AaodB] [to1               ] [swagger-operation-0-1?operationId=operation-0                                 ] [     12174]
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
java.net.NoRouteToHostException: No route to host (Host unreachable)
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_191]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_191]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_191]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_191]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_191]
    at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_191]
    at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:394) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.6.jar!/:4.5.6]
    at org.apache.camel.component.http4.HttpProducer.executeMethod(HttpProducer.java:335) ~[camel-http4-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.component.http4.HttpProducer.process(HttpProducer.java:194) ~[camel-http4-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) ~[camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.component.rest.RestProducer.process(RestProducer.java:86) ~[camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.component.connector.ConnectorProducer.process(ConnectorProducer.java:45) ~[camel-connector-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148) ~[camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at io.syndesis.integration.runtime.logging.ActivityTrackingInterceptStrategy$EventProcessor.process(ActivityTrackingInterceptStrategy.java:79) [integration-runtime-1.6-SNAPSHOT.jar!/:1.6-SNAPSHOT]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:197) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:79) [camel-core-2.21.0.fuse-730054.jar!/:2.21.0.fuse-730054]
    at java.util.TimerThread.mainLoop(Timer.java:555) [na:1.8.0_191]
    at java.util.TimerThread.run(Timer.java:505) [na:1.8.0_191]
zregvart commented 5 years ago

@mmuzikar bare in mind that the integration is running on OpenShift and that it needs to resolve todo-syndesis.my-minishift.syndesis.io to an IP to invoke that service. The fact that you can resolve it on your machine doesn't guarantee that it can be resolved on OpenShift also. I'm guessing you added *.my-minishift.syndesis.io to your hosts file.

I think it should work if you set the hostname to http://todo.syndesis.svc:8080 if syndesis is the project name you've installed Syndesis to. You could also use the route hostname for the todo app, not sure what that is in your environment (if it's not *.my-minishift.syndesis.io, that doesn't work).

mmuzikar commented 5 years ago

@zregvart Sorry for the late reply, setting the hostname to http://todo.syndesis.svc:8080 worked as you said, but previously I was always able to use todo-syndesis.my-minishift.syndesis.io. Not sure if it's due to any config changes I don't remember doing or if it's really a bug. What do you think?

heiko-braun commented 5 years ago

@zregvart Can we close this?

zregvart commented 5 years ago

Looks like a local issue to me, we make sure that the host parameter for the /swagger.[json|yaml] matches the requested host, so in that case anything that can be resolved from Syndesis server should be resolved from the integration pod.

https://github.com/syndesisio/todo-example/blob/7f32dee2ab61fc98c105b4c536813849b87d919a/swagger.json.php#L12