{"record":{"id":"f89ffaf271a162c2","repo":"apache/pulsar","slug":"schema-compatibility-strategy-is-always-incompatib","errorCode":null,"errorMessage":"Schema compatibility strategy is ALWAYS_INCOMPATIBLE","messagePattern":"Schema compatibility strategy is ALWAYS_INCOMPATIBLE","errorType":"exception","errorClass":"IncompatibleSchemaException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaCompatibilityCheck.java","lineNumber":75,"sourceCode":"            checkCompatible(from, to, strategy);\n            return true;\n        } catch (IncompatibleSchemaException e) {\n            return false;\n        }\n    }\n\n    SchemaCompatibilityCheck DEFAULT = new SchemaCompatibilityCheck() {\n\n        @Override\n        public SchemaType getSchemaType() {\n            return SchemaType.NONE;\n        }\n\n        @Override\n        public void checkCompatible(SchemaData from, SchemaData to, SchemaCompatibilityStrategy strategy)\n                throws IncompatibleSchemaException {\n            if (strategy == SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE) {\n                throw new IncompatibleSchemaException(\"Schema compatibility strategy is ALWAYS_INCOMPATIBLE\");\n            }\n        }\n\n        @Override\n        public void checkCompatible(Iterable<SchemaData> from, SchemaData to, SchemaCompatibilityStrategy strategy)\n                throws IncompatibleSchemaException {\n            if (strategy == SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE) {\n                throw new IncompatibleSchemaException(\"Schema compatibility strategy is ALWAYS_INCOMPATIBLE\");\n            }\n        }\n\n    };\n}\n","sourceCodeStart":57,"sourceCodeEnd":89,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaCompatibilityCheck.java#L57-L89","documentation":"The broker's schema compatibility checker throws IncompatibleSchemaException when the configured compatibility strategy is ALWAYS_INCOMPATIBLE. ALWAYS_INCOMPATIBLE means no schema update is ever considered compatible, so the check rejects every update up front without comparing schema content. It is a deliberate hard stop, not a comparison result.","triggerScenarios":"Calling SchemaRegistryService.checkCompatible(SchemaData from, SchemaData to, strategy) (single-schema overload, SchemaCompatibilityCheck.java:75) with strategy == SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE, e.g. when updating a topic schema whose namespace policy has schemaCompatibilityStrategy set to ALWAYS_INCOMPATIBLE.","commonSituations":"Namespace/topic policies were intentionally set to ALWAYS_INCOMPATIBLE to freeze the schema; ops copied a sample policy that disabled evolution; a default strategy template in a multi-tenant setup uses ALWAYS_INCOMPATIBLE; tooling passes null/placeholder strategy resolved to ALWAYS_INCOMPATIBLE.","solutions":["Change the namespace policy: pulsar-admin namespaces set-schema-compatibility-strategy <ns> --strategy BACKWARD (or FORWARD/FULL, incl. _TRANSITIVE variants).","If the schema should never change, do not attempt the update at all; keep the existing schema and version-bump the topic instead.","Verify with pulsar-admin namespaces get-schema-compatibility-strategy which strategy is actually applied before calling the admin API."],"exampleFix":"// before\nadmin.schemas().createSchema(\"my-topic\", schemaInfo); // ns policy = ALWAYS_INCOMPATIBLE\n// after\nadmin.namespaces().setSchemaCompatibilityStrategy(\"my-tenant/my-ns\",\n    SchemaCompatibilityStrategy.BACKWARD);\nadmin.schemas().createSchema(\"my-topic\", schemaInfo);","handlingStrategy":"validation","validationCode":"import org.apache.pulsar.common.policies.data.SchemaCompatibilityStrategy;\nif (strategy == SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE) {\n    throw new IllegalArgumentException(\n        \"Schema updates are disabled (ALWAYS_INCOMPATIBLE); change the namespace policy first\");\n}","typeGuard":"boolean updatable(SchemaCompatibilityStrategy s) {\n    return s != null && s != SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE;\n}","tryCatchPattern":null,"preventionTips":["Check the namespace policy with pulsar-admin namespaces get-schema-compatibility-strategy before updating schemas.","Never configure ALWAYS_INCOMPATIBLE on namespaces whose schemas are expected to evolve; prefer BACKWARD or FULL.","Gate automated schema deployments on a policy preflight check."],"tags":["pulsar","schema-registry","configuration"],"backgroundTag":"schema-always-incompatible","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}