{"record":{"id":"c4f889ce19ff8c10","repo":"apache/flink","slug":"serialized-data-with-version-d-cannot-be-read-by","errorCode":null,"errorMessage":"Serialized data with version %d cannot be read by serializer with version %d","messagePattern":"Serialized data with version (.+?) cannot be read by serializer with version (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/writer/GSCommitRecoverableSerializer.java","lineNumber":141,"sourceCode":"            long lsbValue = dataInputStream.readLong();\n            UUID componentObjectId = new UUID(msbValue, lsbValue);\n            componentObjectIds.add(componentObjectId);\n        }\n\n        GSCommitRecoverable recoverable =\n                new GSCommitRecoverable(finalBlobIdentifier, componentObjectIds);\n        LOGGER.trace(\"Deserialized commit recoverable {}\", recoverable);\n        return recoverable;\n    }\n\n    @Override\n    public GSCommitRecoverable deserialize(int version, byte[] serialized) throws IOException {\n        Preconditions.checkArgument(version > 0);\n        Preconditions.checkNotNull(serialized);\n\n        // ensure this serializer can deserialize data with this version\n        if (version > SERIALIZER_VERSION) {\n            throw new IOException(\n                    String.format(\n                            \"Serialized data with version %d cannot be read by serializer with version %d\",\n                            version, SERIALIZER_VERSION));\n        }\n\n        try (ByteArrayInputStream inputStream = new ByteArrayInputStream(serialized)) {\n            try (DataInputStream dataInputStream = new DataInputStream(inputStream)) {\n                return deserializeCommitRecoverable(dataInputStream);\n            }\n        }\n    }\n}\n","sourceCodeStart":123,"sourceCodeEnd":154,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/writer/GSCommitRecoverableSerializer.java#L123-L154","documentation":"Thrown by GSCommitRecoverableSerializer.deserialize when the persisted recoverable-commit data was written by a NEWER serializer (version number higher than SERIALIZER_VERSION of the code reading it). The GCS recoverable writer stores a version tag with each serialized GSCommitRecoverable so that older code can refuse data it cannot interpret instead of corrupting it. This is a forward-incompatibility guard for checkpoint/savepoint metadata of in-flight file sinks.","triggerScenarios":"Restoring a checkpoint/savepoint (or resuming a pending commit) whose GSCommitRecoverable was serialized by a newer flink-gs-fs-hadoop plugin, i.e. version > SERIALIZER_VERSION of the jar currently on the classpath; then calling GSCommitRecoverableSerializer.deserialize(version, bytes).","commonSituations":"Downgrading the Flink GCS filesystem plugin or Flink version after a job already checkpointed pending commit recoverables; mixing plugin versions between the job that wrote the state and the job that reads it; reading state produced by a newer Flink in a rollback during an upgrade.","solutions":["Roll forward: run the job with the same or newer flink-gs-fs-hadoop / Flink version that wrote the checkpoint","Verify the plugin jar version in lib/ matches the version that produced the checkpoint (no mixed jars on the classpath)","If the state is disposable, discard the stale pending-commit state and restart the job from a fresh savepoint or clear the in-flight data (accepting data loss for those pending files)"],"exampleFix":"// before: restore attempted with older plugin\n// after: use the same/newer plugin version that serialized the state\n// java -lib flink-gs-fs-hadoop-<newer-version>.jar matching the checkpoint","handlingStrategy":"try-catch","validationCode":"// before restore, check the persisted version if accessible\nif (storedVersion > GSCommitRecoverableSerializer.SERIALIZER_VERSION) {\n    throw new IllegalStateException(\"State written by newer GCS serializer; upgrade plugin first\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    committer = serializer.deserialize(version, bytes);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"cannot be read by serializer\")) {\n        // version mismatch: require plugin roll-forward, do not retry\n        throw new IllegalStateException(\"GCS recoverable state version too new\", e);\n    }\n    throw e;\n}","preventionTips":["Pin one flink-gs-fs-hadoop version across all environments","Before downgrading Flink/plugin, finish or clear all pending file-sink commits","Treat serializer-version errors as configuration failures, not transient I/O"],"tags":["serialization","version-mismatch","gcs","checkpoint-restore"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}