{"record":{"id":"0214f7fe0212af50","repo":"apache/flink","slug":"unknown-snapshot-version-for-avroserializersnapsho","errorCode":null,"errorMessage":"unknown snapshot version for AvroSerializerSnapshot %s","messagePattern":"unknown snapshot version for AvroSerializerSnapshot (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSerializerSnapshot.java","lineNumber":101,"sourceCode":"            throws IOException {\n        switch (readVersion) {\n            case 1:\n                {\n                    readV1(in, userCodeClassLoader);\n                    return;\n                }\n            case 2:\n                {\n                    readV2(in, userCodeClassLoader);\n                    return;\n                }\n            case 3:\n                {\n                    readV3(in, userCodeClassLoader);\n                    return;\n                }\n            default:\n                throw new IllegalArgumentException(\n                        \"unknown snapshot version for AvroSerializerSnapshot \" + readVersion);\n        }\n    }\n\n    private void readV1(DataInputView in, ClassLoader userCodeClassLoader) throws IOException {\n        final String previousSchemaDefinition = in.readUTF();\n        this.schema = parseAvroSchema(previousSchemaDefinition);\n        this.runtimeType = findClassOrFallbackToGeneric(userCodeClassLoader, schema.getFullName());\n        this.runtimeSchema = tryExtractAvroSchema(userCodeClassLoader, runtimeType);\n    }\n\n    private void readV2(DataInputView in, ClassLoader userCodeClassLoader) throws IOException {\n        final String previousRuntimeTypeName = in.readUTF();\n        final String previousSchemaDefinition = in.readUTF();\n\n        this.runtimeType = findClassOrThrow(userCodeClassLoader, previousRuntimeTypeName);\n        this.schema = parseAvroSchema(previousSchemaDefinition);\n        this.runtimeSchema = tryExtractAvroSchema(userCodeClassLoader, runtimeType);","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSerializerSnapshot.java#L83-L119","documentation":"IllegalArgumentException from AvroSerializerSnapshot.read when the snapshot's version int is not 1, 2, or 3. The serialized snapshot format is unrecognized — either corrupted state or a snapshot written by an incompatible Flink version.","triggerScenarios":"Restoring a checkpoint containing an AvroSerializerSnapshot with an unknown leading version int; reading arbitrary bytes as state; version-skipping upgrades (e.g. 1.3 savepoint into 1.15+).","commonSituations":"Corrupted checkpoint files due to job kill during write; restoring very old savepoints beyond the supported migration window; classpath mixing Flink jars of different versions.","solutions":["Confirm the Flink version that wrote the state matches a supported upgrade path (upgrade one major version at a time).","Ensure a single consistent Flink distribution on the classpath (no mixed jars).","If corruption is confirmed, discard the checkpoint and restore from upstream data / new snapshot."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    env.execute();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"unknown snapshot version\")) {\n        // unsupported or corrupted snapshot: rebuild state instead of retrying\n        log.error(\"Unrecognized AvroSerializerSnapshot version; cannot restore\", e);\n    }\n    throw e;\n}","preventionTips":["Follow the documented Flink upgrade path (savepoint -> upgrade -> restore) rather than jumping versions.","Keep classpath free of mixed-version flink jars.","Test restore of production checkpoints in a staging environment after every upgrade."],"tags":["avro","state-restore","snapshot-version","checkpoint","flink"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}