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

Randall Hauch edited comment on KAFKA-4827 at 11/10/17 3:40 PM:
----------------------------------------------------------------

[~sliebau], I re-added to the fix version the {{0.10.1.2}}, {{0.10.2.2}}, and 
the newly-created {{0.11.0.3}} unreleased versions so that we know to backport 
this.

{quote}
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.
{quote}

I agree that it needs to be fixed in all URLs that are created with the 
connector name. 

{quote}
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?
{quote}

Actually, I'd prefer to have this issue fixed in a separate PR, and then to 
have KAFKA-4930 deal with the prevention of connectors with empty names. 
They're pretty unrelated, and since testing of this issue will indeed be the 
majority of the work I think it's better to keep the PRs separated. Also, there 
is another new contributor, Arjun, that is interested in working on this issue 
and can spend time over the next few days. Would that be okay?


was (Author: rhauch):
[~sliebau], I re-added {{0.10.1.2}} and {{0.10.2.2}} to the fix version so that 
we know to backport this.

{quote}
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.
{quote}

I agree that it needs to be fixed in all URLs that are created with the 
connector name. 

{quote}
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?
{quote}

Actually, I'd prefer to have this issue fixed in a separate PR, and then to 
have KAFKA-4930 deal with the prevention of connectors with empty names. 
They're pretty unrelated, and since testing of this issue will indeed be the 
majority of the work I think it's better to keep the PRs separated. Also, there 
is another new contributor, Arjun, that is interested in working on this issue 
and can spend time over the next few days. Would that be okay?

> 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, 1.1.0, 0.11.0.3
>
>
> 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