title: Unknown KafkaError 87 from Kafka
body: <p>I am writing an Avro message to Kafka using Confluent:</p>
  <pre class="lang-py prettyprint-override"><code>import avro_validator
  import avro.schema
  from confluent_kafka import avro as confluent_avro
  from confluent_kafka.cimpl import KafkaError, Message
  
  
  schema = avro.schema.Parse(schema_src)
  validator = avro_validator.schema.Schema(schema_file).parse()
  record_schema = confluent_avro.loads(str(schema))
  
  producer = AvroProducer(conf, default_value_schema=record_schema)
  
  validator.validate(data)  # confirms the data matches the avro schema
  
  producer.produce(
    topic=topic,
    value=data,
   callback=lambda err, msg: on_delivery(err, msg, data),
  )
  producer.poll(0)
  </code></pre>
  <p>My callback function is as follows:</p>
  <pre><code>
  def on_delivery(err: Optional[KafkaError], msg: Message, data: dict):
      if err is not None:
          logger.exception(
              f&quot;Delivery Report: Message production failed: {err.name()} {err.code()} {err.str()}&quot;
          )
      else:
          logger.debug(
              f&quot;Delivery Report: Message produced successfully: {msg.value()}&quot;
          )
  </code></pre>
  <p>All I get is the vague message:
  <code>Delivery Report: Message production failed: ERR_87? 87 Err-87?</code>
  I have no idea what error code 87 means, it does not appear to be listed in the enumerations for KafkaError.</p>
  <p>Update: Thanks to the comments below I have determined that 87 means &quot;<a href="https://kafka.apache.org/protocol#protocol_error_codes" rel="nofollow noreferrer">INVALID_RECORD</a> This record has failed the validation on broker and hence will be rejected.&quot;</p>
  <p>Any help would be appreciated, thanks!</p>