{"record":{"id":"8aaec1c24de8f048","repo":"apache/flink","slug":"unrecognized-compatibility-type","errorCode":null,"errorMessage":"unrecognized compatibility type.","messagePattern":"unrecognized compatibility type\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerUtil.java","lineNumber":205,"sourceCode":"        public boolean isIncompatible() {\n            return compatibilityType == TypeSerializerSchemaCompatibility.Type.INCOMPATIBLE;\n        }\n\n        public TypeSerializerSchemaCompatibility<T> getFinalResult() {\n            checkState(\n                    compatibilityType\n                            != TypeSerializerSchemaCompatibility.Type\n                                    .COMPATIBLE_WITH_RECONFIGURED_SERIALIZER,\n                    \"unable to build final result if intermediate compatibility type is COMPATIBLE_WITH_RECONFIGURED_SERIALIZER.\");\n            switch (compatibilityType) {\n                case COMPATIBLE_AS_IS:\n                    return TypeSerializerSchemaCompatibility.compatibleAsIs();\n                case COMPATIBLE_AFTER_MIGRATION:\n                    return TypeSerializerSchemaCompatibility.compatibleAfterMigration();\n                case INCOMPATIBLE:\n                    return TypeSerializerSchemaCompatibility.incompatible();\n                default:\n                    throw new IllegalStateException(\"unrecognized compatibility type.\");\n            }\n        }\n\n        public TypeSerializer<?>[] getNestedSerializers() {\n            checkState(\n                    compatibilityType == TypeSerializerSchemaCompatibility.Type.COMPATIBLE_AS_IS\n                            || compatibilityType\n                                    == TypeSerializerSchemaCompatibility.Type\n                                            .COMPATIBLE_WITH_RECONFIGURED_SERIALIZER,\n                    \"only intermediate compatibility types COMPATIBLE_AS_IS and COMPATIBLE_WITH_RECONFIGURED_SERIALIZER have nested serializers.\");\n            return nestedSerializers;\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private static <E> TypeSerializerSchemaCompatibility<E> resolveCompatibility(\n            TypeSerializerSnapshot<?> newSnapshot, TypeSerializerSnapshot<?> oldSnapshot) {\n","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerUtil.java#L187-L223","documentation":"Thrown by IntermediateCompatibilityResult.asFinalCompatibilityResult in the default branch of a switch on TypeSerializerSchemaCompatibility.Type. Only COMPATIBLE_AS_IS, COMPATIBLE_AFTER_MIGRATION, and INCOMPATIBLE are handled (COMPATIBLE_WITH_RECONFIGURED_SERIALIZER is guarded by a precondition check earlier). Reaching the default means the internal compatibility-type enum has a value the code does not know about — a sign of a version mismatch between flink-core modules or an internal bug.","triggerScenarios":"An internal code path constructs an IntermediateCompatibilityResult with a compatibilityType that is not one of the three handled cases. This is effectively impossible with stock Flink unless there is a module version skew (e.g. flink-core from one Flink minor version mixed with flink-runtime from another) or bytecode manipulation introduced a new enum constant.","commonSituations":"Mixed Flink JAR versions on the classpath (e.g. flink-core 1.18 with flink-runtime 1.17). A shaded/relocated Flink dependency that altered the enum. A bug in a custom fork of Flink that added an enum constant without updating this switch.","solutions":["Ensure all Flink modules on the classpath share the exact same version (check dependency tree with mvn dependency:tree).","Remove conflicting transitive Flink dependencies or use a BOM/dependencyManagement to pin one version.","If running a custom Flink fork, update this switch to handle any new TypeSerializerSchemaCompatibility.Type constant."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify no version skew across Flink modules before deploying\n// mvn dependency:tree -Dincludes=org.apache.flink  should show ONE version everywhere","typeGuard":null,"tryCatchPattern":"try {\n    backend.restore(state);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"unrecognized compatibility type\")) {\n        log.error(\"Flink module version skew detected. Align all flink-* JARs to one version.\");\n    }\n    throw e;\n}","preventionTips":["Pin all org.apache.flink dependencies to a single version using a BOM or dependencyManagement.","Run mvn dependency:tree and verify no conflicting Flink versions are on the classpath.","Avoid mixing connector JARs built against different Flink minor versions."],"tags":["serialization","state","schema-compatibility","internal-invariant","version-mismatch"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}