title: Kafka Sink Connector fails: Schema not found; error code: 40403
body: <p>I have a sink connector with the following configuration</p>
  
  <pre><code>{
      "name": "sink-test-mariadb-MY_TOPIC",
      "config": { 
                  "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector",
                  "tasks.max":"10",
                  "topics":"MY_TOPIC",
                  "connection.url":"jdbc:mariadb://localhost:3306/myschema?user=myuser&amp;password=mypass",
                  "auto.create":"false",
                  "auto.evolve":"true",
                  "table.name.format":"MY_TABLE",
                  "pk.mode":"record_value",
                  "pk.fields":"ID",
                  "insert.mode":"upsert",
                  "transforms":"ExtractField",
                  "transforms.ExtractField.type":"org.apache.kafka.connect.transforms.ExtractField$Value",
                  "transforms.ExtractField.field":"data"
          }
  }
  </code></pre>
  
  <p>and after a while all the tasks of the connector fail with the following error: </p>
  
  <pre><code>{
      "state": "FAILED",
      "trace": "org.apache.kafka.connect.errors.DataException: MY_TOPIC
                  at io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:95)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:468)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:301)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:205)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:173)
                  at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170)
                  at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                  at java.lang.Thread.run(Thread.java:748)
              Caused by: org.apache.kafka.common.errors.SerializationException: Error retrieving Avro schema for id 802
              Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Schema not found; error code: 40403
                  at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:202)
                  at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:229)
                  at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:409)
                  at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:402)
                  at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaByIdFromRegistry(CachedSchemaRegistryClient.java:119)
                  at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getBySubjectAndId(CachedSchemaRegistryClient.java:192)
                  at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getById(CachedSchemaRegistryClient.java:168)
                  at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserialize(AbstractKafkaAvroDeserializer.java:121)
                  at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserializeWithSchemaAndVersion(AbstractKafkaAvroDeserializer.java:194)
                  at io.confluent.connect.avro.AvroConverter$Deserializer.deserialize(AvroConverter.java:120)
                  at io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:83)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:468)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:301)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:205)
                  at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:173)
                  at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170)
                  at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                  at java.lang.Thread.run(Thread.java:748)",
      "id": 0,
      "worker_id": "localhost:8083"
  }
  </code></pre>
  
  <p>The connector manages to synchronise the topic with tha database but it suddenly fails without any reason. I am also very sure that the schema is there. Its subject appears in the list returned by calling schema registry API <code>localhost:8081/subjects</code> </p>
  
  <pre><code>[
    ...
    MY_TOPIC-value
    ...
  ]
  </code></pre>