{
  "id": "data/kafka-json-deserialization-with-schema-registry",
  "signature": "Kafka JSON deserialization fails with 'Unknown schema ID' when schema registry is not configured",
  "signature_zh": "Kafka JSON反序列化因未配置模式注册表而失败，报错'未知模式ID'",
  "regex": "Unknown schema ID|Schema registry not configured",
  "domain": "data",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Kafka producer writes JSON data with schema registry enabled, but the consumer does not have schema registry configured or the schema ID is not present in the registry.",
  "root_cause_type": "generic",
  "root_cause_zh": "Kafka生产者启用了模式注册表写入JSON数据，但消费者未配置模式注册表，或者模式ID不在注册表中。",
  "versions": [
    {
      "version": "Confluent Platform 7.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kafka-python 2.0.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Apache Kafka 3.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Disabling schema registry on the producer side",
      "why_fails": "Producer may have already written messages with schema IDs; disabling registry only affects new messages, not existing ones.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually editing the Kafka topic to remove schema IDs from message headers",
      "why_fails": "Editing message headers is complex and risky; schema IDs are embedded in the message payload, not just headers.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Configure the consumer to use the same schema registry URL: Add 'schema.registry.url=http://localhost:8081' to consumer properties.",
      "success_rate": 0.95,
      "how": "Configure the consumer to use the same schema registry URL: Add 'schema.registry.url=http://localhost:8081' to consumer properties.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If schema registry is unavailable, use a custom deserializer that ignores schema IDs: kafka.deserializers.string_deserializer for raw JSON.",
      "success_rate": 0.8,
      "how": "If schema registry is unavailable, use a custom deserializer that ignores schema IDs: kafka.deserializers.string_deserializer for raw JSON.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "配置消费者使用相同的模式注册表URL：在消费者属性中添加'schema.registry.url=http://localhost:8081'。",
    "如果模式注册表不可用，使用忽略模式ID的自定义反序列化器：使用kafka.deserializers.string_deserializer处理原始JSON。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.confluent.io/platform/current/schema-registry/index.html",
  "official_doc_section": null,
  "error_code": "KAFKA-ERR-100",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-04-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}