Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4827

Kafka connect: error with special characters in connector name

    XMLWordPrintableJSON

Details

    Description

      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

      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 
      

      returns an error 500 <Request Failed> and log the following

      [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
      

      Connector is accessible at connectors/file-connector%0D and task is correctly running, but there may be some problem underneath

      Attachments

        Issue Links

          Activity

            People

              wicknicks Arjun Satish
              Treziac Aymeric Bouvet
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: