# Kafka Connect Avro deserialization fails: field removed in new schema version without default

- **ID:** `data/kafka-connect-avro-schema-evolution-field-removal`
- **Domain:** data
- **Category:** schema_error
- **Error Code:** `SchemaCompatibilityException`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Avro schema evolution allows adding fields with defaults but not removing fields; a schema that removes a previously existing field without providing a default value breaks backward compatibility.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Confluent Schema Registry 7.4+ | active | — | — |
| Apache Avro 1.11.0+ | active | — | — |
| Kafka Connect 3.4+ | active | — | — |

## Workarounds

1. **Register a new schema version with the removed field re-added as optional with null default: `{"name": "removedField", "type": ["null", "string"], "default": null}`** (95% success)
   ```
   Register a new schema version with the removed field re-added as optional with null default: `{"name": "removedField", "type": ["null", "string"], "default": null}`
   ```
2. **Use schema evolution with FORWARD compatibility mode if possible, allowing removal but requiring defaults for new fields.** (80% success)
   ```
   Use schema evolution with FORWARD compatibility mode if possible, allowing removal but requiring defaults for new fields.
   ```
3. **Implement custom deserializer that uses a reader schema with the removed field as optional.** (85% success)
   ```
   Implement custom deserializer that uses a reader schema with the removed field as optional.
   ```

## Dead Ends

- **** — Breaks all future schema validation and can cause data loss for downstream consumers. (70% fail)
- **** — Schema Registry enforces compatibility based on schema ID; editing schema after registration may conflict with existing versions. (50% fail)
