[ 
https://issues.apache.org/jira/browse/KAFKA-4827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16247275#comment-16247275
 ] 

Sönke Liebau commented on KAFKA-4827:
-------------------------------------

In this particular case the issue was probably a non encoded name when 
forwarding the request, I agree with that. However the same issue will also 
turn up if that request were made to the correct worker, as when processing a 
create request, the connector is created and then ConnectorsResource sends a 
rest request to get the config for that worker and returns this to the sender 
of the original request. In this request the name is not properly url encoded, 
which causes the connector to be created properly, but Connect to return a 
failure as response to the request.
This will be fixed by KAFKA-4930  - resending the request to the leader worker 
is quite related, but might be better fixed separately in this jira. I'll 
change the type of relation on 4930 to reflect this unless you have objections?
I have set aside some time to work on 4930 next week, the fix itself is easy 
and done, however testing turns out to be a bit complex, as I need a running 
webserver and backend since url decoding happens there and I have not yet found 
test cases that I can piggyback upon.

> Kafka connect: error with special characters in connector name
> --------------------------------------------------------------
>
>                 Key: KAFKA-4827
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4827
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>    Affects Versions: 0.10.1.0
>            Reporter: Aymeric Bouvet
>            Assignee: Sönke Liebau
>            Priority: Minor
>             Fix For: 0.10.1.2, 0.10.2.2, 0.11.0.2, 1.1.0
>
>
> When creating a connector, if the connector name (and possibly other 
> properties) end with a carriage return, kafka-connect will create the config 
> but report error
> {code}
> cat << EOF > file-connector.json
> {
>   "name": "file-connector\r",
>   "config": {
>     "topic": "kafka-connect-logs\r",
>     "tasks.max": "1",
>     "file": "/var/log/ansible-confluent/connect.log",
>     "connector.class": 
> "org.apache.kafka.connect.file.FileStreamSourceConnector"
>   }
> }
> EOF
> curl -X POST -H "Content-Type: application/json" -H "Accept: 
> application/json" -d @file-connector.json localhost:8083/connectors 
> {code}
> returns an error 500 <Request Failed> and log the following
> {code}
> [2017-03-01 18:25:23,895] WARN  (org.eclipse.jetty.servlet.ServletHandler)
> javax.servlet.ServletException: java.lang.IllegalArgumentException: Illegal 
> character in path at index 27: /connectors/file-connector4
>         at 
> org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
>         at 
> org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
>         at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
>         at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
>         at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
>         at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
>         at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
>         at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
>         at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
>         at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
>         at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>         at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
>         at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>         at 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
>         at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
>         at 
> org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:159)
>         at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
>         at org.eclipse.jetty.server.Server.handle(Server.java:499)
>         at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
>         at 
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
>         at 
> org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
>         at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
>         at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.IllegalArgumentException: Illegal character in path at 
> index 27: /connectors/file-connector4
>         at java.net.URI.create(URI.java:852)
>         at 
> org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource.createConnector(ConnectorsResource.java:100)
>         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 
> org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
>         at 
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
>         at 
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
>         at 
> org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
>         at 
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
>         at 
> org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
>         at 
> org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
>         at 
> org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
>         at 
> org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
>         at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
>         at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
>         at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
>         at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
>         at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
>         at 
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
>         at 
> org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
>         at 
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
>         at 
> org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
>         ... 23 more
> Caused by: java.net.URISyntaxException: Illegal character in path at index 
> 27: /connectors/file-connector4
>         at java.net.URI$Parser.fail(URI.java:2848)
>         at java.net.URI$Parser.checkChars(URI.java:3021)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3105)
>         at java.net.URI$Parser.parse(URI.java:3063)
>         at java.net.URI.<init>(URI.java:588)
>         at java.net.URI.create(URI.java:850)
>         ... 46 more
> {code}
> Connector is accessible at connectors/file-connector%0D and task is correctly 
> running, but there may be some problem underneath



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to