0

When i run my kafka connect job, i get the error below

[2017-04-25 14:56:22,806] ERROR Failed to create job for ./etc/kafka-connect-jdbc/sqlserver.properties (org.apache.kafka.connect.cli.ConnectStandalone:88)
[2017-04-25 14:56:22,808] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:99)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid (use the endpoint `/{connectorType}/config/validate` to get a full list of errors)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:80)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:67)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:96)
Caused by: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: 
Connector configuration is invalid (use the endpoint `/{connectorType}/config/validate` to get a full list of errors)
    at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.putConnectorConfig(StandaloneHerder.java:161)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:93)

My properties file is

name=test-sqlserver-jdbc-autoincrement
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=jdbc:sqlserver://192.168.9.142:1433;databaseName=postilion;user=elasticsearch;password=elasticsearch
query=select convert(varchar(10), date_time, 120) as date,convert(char(12), 
date_time, 114) as time, * from support_notifications
mode=timestamp+incrementing
timestamp.column.name=date_time
incrementing.column.name=event_nr
topic.prefix=test-events

I've tried to do a GET call to kafka connect(Before it crashes) using curl http://localhost:8083 /JdbcSourceConnector/config/validate and i get the response {"version":"0.10.2.0-cp1","commit":"64c9b42f3319cdc9"}curl: (3) <url> malformed. Any ideas what i'm doing wrong as this job worked in kafka 0.9.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Zigmaphi
  • 15
  • 5
  • Kafka 0.10.2.0 had a bug regarding the configuration validation where it didn't report the real issues... We released 0.10.2.1 yesterday, which should fix this (and 28 other bugs). Give it a try. – Gwen Shapira Apr 29 '17 at 00:46
  • @Zigmaphi You go the response `curl http://localhost:8083 /JdbcSourceConnector/config/validate` because you had a space between "8083" and "/JdbcSourceConnector" in your request. You should have gotten a response similar to ` { "error_code": 400, "message": "Connector config {} contains no connector type" }` – Abdurrahman Adebiyi Jun 15 '17 at 12:19

1 Answers1

0

So i found a way out. I ended up altering the mode from timestamp+incrementing to incrementing in the properties file and removed the line timestamp.column.name=date_time. The properties file now looks like this

name=test-sqlserver-jdbc-autoincrement
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=jdbc:sqlserver://192.168.9.142:1433;databaseName=postilion;user=elasticsearch;password=elasticsearch
query=select convert(varchar(10), date_time, 120) as date,convert(char(12), date_time, 114) as time, * from support_notifications
mode=incrementing
incrementing.column.name=event_nr
topic.prefix=postilion-events
Zigmaphi
  • 15
  • 5