Confluent Kakfa Connect - HTTP 405 Method Not Allowed

4,674 views
Skip to first unread message

Pinkesh Valdria

unread,
Sep 17, 2018, 5:51:43 AM9/17/18
to Confluent Platform

I am trying to understand why I get the below error when I run this command

[kadmin@cf-worker-2 ~]$ echo $CWURL

[kadmin@cf-worker-2 ~]$ curl -X PUT -H "Content-Type:application/json" --data '{"name": "SourceTest1","config":{"connector.class":"org.apache.kafka.connect.file.FileStreamSourceConnector","topic":"vtest1","file":"/opt/confluent/etc/kafka/connect-distributed.properties"}}' $CWURL/connectors

{"error_code":405,"message":"HTTP 405 Method Not Allowed"}

I have 2 worker nodes and only worker-2 has Connect REST API listening on port 8083

I am running Confluent Enterprise 5.0.0


[2018-09-17 09:20:09,325] INFO 10.0.1.3 - - [17/Sep/2018:09:20:09 +0000] "GET /connectors HTTP/1.1" 200 2  2 (org.apache.kafka.connect.runtime.rest.RestServe
r:60)
[2018-09-17 09:20:57,964] ERROR Uncaught exception in REST call to /connectors (org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper:61)
javax.ws.rs.NotAllowedException: HTTP 405 Method Not Allowed
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.getMethodRouter(MethodSelectingRouter.java:466)
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.access$000(MethodSelectingRouter.java:94)
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter$4.apply(MethodSelectingRouter.java:779)
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.apply(MethodSelectingRouter.java:371)


Robin Moffatt

unread,
Sep 17, 2018, 6:11:00 AM9/17/18
to confluent...@googlegroups.com
It's POST not PUT :-)

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/63099ebd-ea93-42b5-bba3-d8ae6f6ffbd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pinkesh Valdria

unread,
Sep 17, 2018, 6:22:22 AM9/17/18
to Confluent Platform
Thanks Robin for a quick response.    If I use POST,   i get a different error, but the stacktrace does not have enough info to understand which server/port is not routable. 

Appreciate if you can point me in the right direction,  may be there are other logs I need to see. 


[kadmin@cf-worker-2 ~]$  curl -X POST -H "Content-Type:application/json" --data '{"name": "SourceTest1","config":{"connector.class":"org.apache.kafka.connect.file.FileStreamSourceConnector","topic":"vtest1","file":"/opt/confluent/etc/kafka/connect-distributed.properties"}}' $CWURL/connectors
{"error_code":500,"message":"IO Error trying to forward REST request: java.net.NoRouteToHostException: No route to host"}

[kadmin@cf-worker-2 ~]$ less /opt/confluent/logs/connectDistributed.out 
[2018-09-17 10:17:06,655] ERROR IO error forwarding REST request:  (org.apache.kafka.connect.runtime.rest.RestClient:107)
java.util.concurrent.ExecutionException: java.net.NoRouteToHostException: No route to host
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101)
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:684)
        at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:89)
        at org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource.completeOrForwardRequest(ConnectorsResource.java:264)
        at org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource.createConnector(ConnectorsResource.java:103)
        at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)

.........
.........
Caused by: java.net.NoRouteToHostException: No route to host
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.eclipse.jetty.io.SelectorManager.doFinishConnect(SelectorManager.java:351)
        at org.eclipse.jetty.io.ManagedSelector.processConnect(ManagedSelector.java:185)




On Monday, September 17, 2018 at 3:11:00 AM UTC-7, Robin Moffatt wrote:
It's POST not PUT :-)

On Mon, 17 Sep 2018 at 10:51, Pinkesh Valdria <pinkesh...@gmail.com> wrote:

I am trying to understand why I get the below error when I run this command

[kadmin@cf-worker-2 ~]$ echo $CWURL

[kadmin@cf-worker-2 ~]$ curl -X PUT -H "Content-Type:application/json" --data '{"name": "SourceTest1","config":{"connector.class":"org.apache.kafka.connect.file.FileStreamSourceConnector","topic":"vtest1","file":"/opt/confluent/etc/kafka/connect-distributed.properties"}}' $CWURL/connectors

{"error_code":405,"message":"HTTP 405 Method Not Allowed"}

I have 2 worker nodes and only worker-2 has Connect REST API listening on port 8083

I am running Confluent Enterprise 5.0.0


[2018-09-17 09:20:09,325] INFO 10.0.1.3 - - [17/Sep/2018:09:20:09 +0000] "GET /connectors HTTP/1.1" 200 2  2 (org.apache.kafka.connect.runtime.rest.RestServe
r:60)
[2018-09-17 09:20:57,964] ERROR Uncaught exception in REST call to /connectors (org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper:61)
javax.ws.rs.NotAllowedException: HTTP 405 Method Not Allowed
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.getMethodRouter(MethodSelectingRouter.java:466)
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.access$000(MethodSelectingRouter.java:94)
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter$4.apply(MethodSelectingRouter.java:779)
        at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.apply(MethodSelectingRouter.java:371)


--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.

Robin Moffatt

unread,
Sep 17, 2018, 12:00:16 PM9/17/18
to confluent...@googlegroups.com
Following up on Slack as conversation also started there (http://cnfl.io/slack)


-- 

Robin Moffatt | Developer Advocate | ro...@confluent.io | @rmoff


To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.

To post to this group, send email to confluent...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages