# Kafka JSON deserialization fails with 'Unknown schema ID' when schema registry is not configured

- **ID:** `data/kafka-json-deserialization-with-schema-registry`
- **Domain:** data
- **Category:** config_error
- **Error Code:** `KAFKA-ERR-100`
- **Verification:** ai_generated
- **Fix Rate:** 95%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Confluent Platform 7.4 | active | — | — |
| kafka-python 2.0.2 | active | — | — |
| Apache Kafka 3.5 | active | — | — |

## Workarounds

1. **Configure the consumer to use the same schema registry URL: Add 'schema.registry.url=http://localhost:8081' to consumer properties.** (95% success)
   ```
   Configure the consumer to use the same schema registry URL: Add 'schema.registry.url=http://localhost:8081' to consumer properties.
   ```
2. **If schema registry is unavailable, use a custom deserializer that ignores schema IDs: kafka.deserializers.string_deserializer for raw JSON.** (80% success)
   ```
   If schema registry is unavailable, use a custom deserializer that ignores schema IDs: kafka.deserializers.string_deserializer for raw JSON.
   ```

## Dead Ends

- **Disabling schema registry on the producer side** — Producer may have already written messages with schema IDs; disabling registry only affects new messages, not existing ones. (80% fail)
- **Manually editing the Kafka topic to remove schema IDs from message headers** — Editing message headers is complex and risky; schema IDs are embedded in the message payload, not just headers. (90% fail)
