{
  "id": "data/avro-schema-registry-serialization-version-mismatch",
  "signature": "Avro serialization fails with SchemaRegistryException: incompatible schema version",
  "signature_zh": "Avro序列化失败，SchemaRegistryException：不兼容的schema版本",
  "regex": "(?:SchemaRegistryException|incompatible schema|compatibility.*violation|schema evolution.*rejected)",
  "domain": "data",
  "category": "schema_error",
  "subcategory": null,
  "root_cause": "The Confluent Schema Registry enforces compatibility rules (BACKWARD, FORWARD, FULL) and rejects schema evolution that violates the configured policy, often due to removing fields or changing types in a way that breaks existing consumers.",
  "root_cause_type": "generic",
  "root_cause_zh": "Confluent Schema Registry强制执行兼容性规则（BACKWARD、FORWARD、FULL），并拒绝违反配置策略的schema演进，通常因为删除字段或更改类型导致破坏现有消费者。",
  "versions": [
    {
      "version": "Confluent Platform 7.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Confluent Platform 7.6",
      "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"
    },
    {
      "version": "Apache Kafka 3.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Schema Registry does not allow deletion of schemas that have been used; you must use soft delete or wait for the cleanup policy.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This creates a new subject that existing consumers are not subscribed to, breaking data flow and requiring manual topic reconfiguration.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling compatibility entirely allows any schema change, which can silently break downstream consumers and cause production incidents.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Temporarily set compatibility to BACKWARD_TRANSITIVE for the subject, register the new schema, then revert to original policy: `curl -X PUT -H 'Content-Type: application/vnd.schemaregistry.v1+json' -d '{\"compatibility\": \"BACKWARD_TRANSITIVE\"}' https://registry:8081/config/subject-name`",
      "success_rate": 0.85,
      "how": "Temporarily set compatibility to BACKWARD_TRANSITIVE for the subject, register the new schema, then revert to original policy: `curl -X PUT -H 'Content-Type: application/vnd.schemaregistry.v1+json' -d '{\"compatibility\": \"BACKWARD_TRANSITIVE\"}' https://registry:8081/config/subject-name`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add the new field with a default value to maintain backward compatibility: `{\"name\": \"new_field\", \"type\": \"string\", \"default\": \"\"}`",
      "success_rate": 0.9,
      "how": "Add the new field with a default value to maintain backward compatibility: `{\"name\": \"new_field\", \"type\": \"string\", \"default\": \"\"}`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use FULL_TRANSITIVE compatibility and register a new version that adds fields with defaults and removes no fields",
      "success_rate": 0.88,
      "how": "Use FULL_TRANSITIVE compatibility and register a new version that adds fields with defaults and removes no fields",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Temporarily set compatibility to BACKWARD_TRANSITIVE for the subject, register the new schema, then revert to original policy: `curl -X PUT -H 'Content-Type: application/vnd.schemaregistry.v1+json' -d '{\"compatibility\": \"BACKWARD_TRANSITIVE\"}' https://registry:8081/config/subject-name`",
    "Add the new field with a default value to maintain backward compatibility: `{\"name\": \"new_field\", \"type\": \"string\", \"default\": \"\"}`",
    "Use FULL_TRANSITIVE compatibility and register a new version that adds fields with defaults and removes no fields"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.confluent.io/platform/current/schema-registry/avro.html",
  "official_doc_section": null,
  "error_code": "SchemaRegistryException",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}