{"record":{"id":"9640efa6b675d95b","repo":"apache/flink","slug":"unrecognized-version","errorCode":null,"errorMessage":"Unrecognized version: {}","messagePattern":"Unrecognized version: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java","lineNumber":128,"sourceCode":"        for (TypeSerializerSnapshot<?> snap : nestedSnapshots) {\n            TypeSerializerSnapshot.writeVersionedSnapshot(out, snap);\n        }\n    }\n\n    /** Reads the composite snapshot of all the contained serializers. */\n    public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(\n            DataInputView in, ClassLoader cl) throws IOException {\n        final int magicNumber = in.readInt();\n        if (magicNumber != MAGIC_NUMBER) {\n            throw new IOException(\n                    String.format(\n                            \"Corrupt data, magic number mismatch. Expected %8x, found %8x\",\n                            MAGIC_NUMBER, magicNumber));\n        }\n\n        final int version = in.readInt();\n        if (version != VERSION) {\n            throw new IOException(\"Unrecognized version: \" + version);\n        }\n\n        final int numSnapshots = in.readInt();\n        final TypeSerializerSnapshot<?>[] nestedSnapshots =\n                new TypeSerializerSnapshot<?>[numSnapshots];\n\n        for (int i = 0; i < numSnapshots; i++) {\n            nestedSnapshots[i] = TypeSerializerSnapshot.readVersionedSnapshot(in, cl);\n        }\n\n        return new NestedSerializersSnapshotDelegate(nestedSnapshots);\n    }\n\n    // ------------------------------------------------------------------------\n    //  Utilities\n    // ------------------------------------------------------------------------\n\n    private static TypeSerializer<?>[] snapshotsToRestoreSerializers(","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L110-L146","documentation":"Thrown by NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots when the version integer read after the magic number does not equal the current VERSION constant (1). This means the serialized nested-snapshots segment was written by a format revision the running Flink version does not understand, or the stream is corrupt and the version field holds garbage.","triggerScenarios":"Restoring a checkpoint/savepoint written by a newer Flink version that incremented the NestedSerializersSnapshotDelegate VERSION. Reading corrupt data where the version integer is a random value. A custom serialization format that reused this delegate's binary layout with a different version scheme.","commonSituations":"Upgrading Flink and attempting to restore an old checkpoint whose nested-snapshot format predates the current version (if a legacy read path is missing). Downgrading Flink and reading a checkpoint written by a newer format. File corruption producing a bogus version integer.","solutions":["Restore with the Flink version that wrote the checkpoint, then re-save if you need to migrate.","Follow the Flink upgrade path (only restore from compatible versions; check the state compatibility docs for your versions).","If the file is corrupt (not a version issue), re-take the checkpoint from a good state.","Verify there is no accidental double-read of the stream causing misalignment."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify Flink version compatibility before restore (documented upgrade path)\n// Ensure the writing version and restoring version share NestedSerializersSnapshotDelegate.VERSION","typeGuard":null,"tryCatchPattern":"try {\n    backend.restore(checkpointPath);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"Unrecognized version\")) {\n        log.error(\"Checkpoint written by an incompatible Flink version. Restore with the original version first.\");\n    }\n    throw e;\n}","preventionTips":["Follow the Flink state upgrade path: restore with the version that wrote the checkpoint, take a savepoint, then upgrade.","Do not downgrade Flink below the version that wrote a checkpoint without checking compatibility docs.","Verify checkpoint files are not corrupt (a bogus version integer can mean corruption, not a real version)."],"tags":["serialization","checkpoint","savepoint","version-mismatch","state","io"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}