{"record":{"id":"d118c6b0f9f41a41","repo":"apache/flink","slug":"serialized-data-with-version-d-cannot-be-read-by-d118c6","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/GSResumeRecoverableSerializer.java","lineNumber":91,"sourceCode":"                dataOutputStream.writeLong(recoverable.position);\n\n                // closed\n                dataOutputStream.writeBoolean(recoverable.closed);\n            }\n\n            outputStream.flush();\n            return outputStream.toByteArray();\n        }\n    }\n\n    @Override\n    public GSResumeRecoverable 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\n            try (DataInputStream dataInputStream = new DataInputStream(inputStream)) {\n\n                // deserialize the commit recoverable part\n                GSCommitRecoverable commitRecoverable =\n                        GSCommitRecoverableSerializer.deserializeCommitRecoverable(dataInputStream);\n\n                // position\n                long position = dataInputStream.readLong();\n\n                // closed\n                boolean closed = dataInputStream.readBoolean();","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/writer/GSResumeRecoverableSerializer.java#L73-L109","documentation":"Thrown by GSResumeRecoverableSerializer.deserialize when the serialized resume-recoverable data carries a version newer than this serializer's SERIALIZER_VERSION. Like the commit recoverable, the resume token (write channel id, position, pending blobs) is version-tagged so older code rejects data it cannot safely interpret when resuming a GCS recoverable stream.","triggerScenarios":"Resuming a GCS recoverable output stream from state serialized by a newer flink-gs-fs-hadoop plugin: GSResumeRecoverableSerializer.deserialize receives version > SERIALIZER_VERSION and fails.","commonSituations":"Rolling back Flink or the GCS plugin after pending-file state was checkpointed by a newer version; inconsistent plugin versions across job/task managers; state migration attempts across incompatible versions.","solutions":["Run the restore with the same or newer plugin/Flink version that wrote the resume state","Ensure one consistent flink-gs-fs-hadoop jar version on all nodes' lib/ directories","If the pending file is disposable, discard the unresumable state and let the sink rewrite the file from the last checkpoint"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    recoverable = serializer.deserialize(version, bytes);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"cannot be read by serializer\")) {\n        // state written by newer serializer: upgrade plugin, no point retrying\n    }\n    throw e;\n}","preventionTips":["Keep writer and reader jobs on the same or newer GCS plugin version","Finish pending files before version downgrades","Verify plugin version consistency across the cluster before restores"],"tags":["serialization","version-mismatch","gcs","resume"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}