{"record":{"id":"486e40f169d9d457","repo":"apache/flink","slug":"unrecognized-kryo-registration-serializer-definiti","errorCode":null,"errorMessage":"Unrecognized Kryo registration serializer definition type: {serializerDefinitionType}","messagePattern":"Unrecognized Kryo registration serializer definition type: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializerSnapshotData.java","lineNumber":256,"sourceCode":"                        Class<? extends Serializer<?>> serializerClass =\n                                kryoRegistration.getSerializerClass();\n                        assert serializerClass != null;\n                        out.writeUTF(serializerClass.getName());\n                        break;\n                    }\n                case INSTANCE:\n                    {\n                        try (final DataOutputViewStream outViewWrapper =\n                                new DataOutputViewStream(out)) {\n                            InstantiationUtil.serializeObject(\n                                    outViewWrapper,\n                                    kryoRegistration.getSerializableSerializerInstance());\n                        }\n                        break;\n                    }\n                default:\n                    {\n                        throw new IllegalStateException(\n                                \"Unrecognized Kryo registration serializer definition type: \"\n                                        + serializerDefinitionType);\n                    }\n            }\n        }\n\n        static KryoRegistration tryReadKryoRegistration(\n                DataInputView in, ClassLoader userCodeClassLoader) throws IOException {\n\n            String registeredClassname = in.readUTF();\n            Class<?> registeredClass;\n            try {\n                registeredClass = Class.forName(registeredClassname, true, userCodeClassLoader);\n            } catch (ClassNotFoundException e) {\n                LOG.warn(\n                        \"Cannot find registered class \"\n                                + registeredClassname\n                                + \" for Kryo serialization in classpath;\"","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializerSnapshotData.java#L238-L274","documentation":"When a KryoSerializer snapshot is written, each Kryo registration serializes its serializer definition tagged with a type (CLASS or INSTANCE). The write-side switch in KryoSerializerSnapshotData hits its default branch only if serializerDefinitionType is neither CLASS nor INSTANCE — i.e. the enum was corrupted or an unrecognized value reached the writer. This is effectively an internal invariant violation, not a user configuration error.","triggerScenarios":"An internal caller constructs the write path with an out-of-range serializer-definition ordinal; enum values added to the definition-type enum without updating this switch; memory/state corruption feeding an invalid tag into the snapshot writer.","commonSituations":"Practically never seen from user code; would surface only from incompatible Flink internal versions mixing snapshot formats, or tampered/corrupted checkpoint metadata.","solutions":["Ensure all Flink modules in the job and cluster run the SAME Flink version (no mixed jars on the classpath).","If state was written by an older/newer snapshot format, do not restore it directly — use the state processor API to migrate or discard the checkpoint.","Report as a Flink bug (JIRA) if reproducible with a single clean version — include the checkpoint metadata."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin one Flink version across client and cluster jars.","Never hand-modify or partially write checkpoint metadata.","Report reproducible occurrences to Flink JIRA with the full stack trace."],"tags":["kryo","snapshot","internal-invariant","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}