title: Error retrieving Avro schema for id 1, Subject not found.; error code: 40401
body: <pre><code>Caused by: org.apache.kafka.common.errors.SerializationException: Error retrieving Avro schema for id 1
  Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Subject not found.; error code: 40401
  </code></pre>
  
  <p>Confluent Version 4.1.0</p>
  
  <p>I am consuming data from a couple of topics(topic_1, topic_2) using KTable, joining the data and then pushing the data onto another topic(topic_out) using KStream. (Ktable.toStream())</p>
  
  <p>The data is in avro format</p>
  
  <p>When I check the schema by using</p>
  
  <pre><code>curl -X GET http://localhost:8081/subjects/ 
  </code></pre>
  
  <p>I find </p>
  
  <pre><code>topic_1-value
  topic_1-key
  topic_2-value
  topic_2-key
  topic_out-value
  </code></pre>
  
  <p>but there is no subject with topic_out-key. Why is it not created?</p>
  
  <p>output from topic_out:</p>
  
  <pre><code>kafka-avro-console-consumer --bootstrap-server localhost:9092 --from-beginning --property print.key=true --topic topic_out
  
  "code1  "   {"code":{"string":"code1  "},"personid":{"string":"=NA="},"agentoffice":{"string":"lic1        "},"status":{"string":"a"},"sourcesystem":{"string":"ILS"},"lastupdate":{"long":1527240990138}}
  </code></pre>
  
  <p>I can see the key being generated, but no subject for key.</p>
  
  <p>Why is subject with key required?<br>
  I am feeding this topic to another connector (hdfs-sink) to push the data to hdfs but it fails with below error</p>
  
  <pre><code>Caused by: org.apache.kafka.common.errors.SerializationException: Error retrieving Avro schema for id 5\nCaused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Subject not found.; error code: 40401
  </code></pre>
  
  <p>when I look at the schema-registry.logs, I can see:</p>
  
  <pre><code>[2018-05-24 15:40:06,230] INFO 127.0.0.1 - - 
  [24/May/2018:15:40:06 +0530] "POST /subjects/topic_out-key?deleted=true HTTP/1.1" 404 51  9 (io.confluent.rest-utils.requests:77)
  </code></pre>
  
  <p>any idea why the subject topic_out-key not being created?</p>