{"record":{"id":"d6d72bbc7810a009","repo":"apache/flink","slug":"simpleversionedserializerwrapper-is-not-meant-to-b","errorCode":null,"errorMessage":"SimpleVersionedSerializerWrapper is not meant to be used as a general TypeSerializer for state.","messagePattern":"SimpleVersionedSerializerWrapper is not meant to be used as a general TypeSerializer for state\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerializerTypeSerializerProxy.java","lineNumber":134,"sourceCode":"    }\n\n    @Override\n    public boolean equals(Object other) {\n        return other instanceof SimpleVersionedSerializerTypeSerializerProxy\n                && ((SimpleVersionedSerializerTypeSerializerProxy<?>) other)\n                        .serializerSupplier\n                        .get()\n                        .equals(serializerSupplier.get());\n    }\n\n    @Override\n    public int hashCode() {\n        return serializerSupplier.get().hashCode();\n    }\n\n    @Override\n    public TypeSerializerSnapshot<T> snapshotConfiguration() {\n        throw new UnsupportedOperationException(\n                \"SimpleVersionedSerializerWrapper is not meant to be used as a general TypeSerializer for state.\");\n    }\n\n    private SimpleVersionedSerializer<T> getSerializer() {\n        if (cachedSerializer != null) {\n            return cachedSerializer;\n        }\n        cachedSerializer = serializerSupplier.get();\n        return cachedSerializer;\n    }\n}\n","sourceCodeStart":116,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerializerTypeSerializerProxy.java#L116-L146","documentation":"Thrown unconditionally by SimpleVersionedSerializerTypeSerializerProxy.snapshotConfiguration(). The proxy intentionally does not implement TypeSerializerSnapshot because it is a bridge for internal operators that need both SimpleVersionedSerializer and TypeSerializer semantics, not a general-purpose state serializer. Calling snapshotConfiguration (which the state backend does when registering a serializer for keyed/operator state) is a misuse.","triggerScenarios":"Registering a SimpleVersionedSerializerTypeSerializerProxy as the serializer for managed state (keyed or operator state); frameworks that call snapshotConfiguration() during checkpoint barrier processing or state registration.","commonSituations":"Accidentally wrapping a SimpleVersionedSerializer in the proxy and using it where a full TypeSerializer (with snapshot) is required; misconfigured state backend that receives a proxy instead of a proper TypeSerializer.","solutions":["Do not use SimpleVersionedSerializerTypeSerializerProxy as a state TypeSerializer; provide a proper TypeSerializer implementation with a TypeSerializerSnapshot.","If you need versioned serialization in state, implement a TypeSerializerSnapshot manually or use a serializer framework that supports it.","Reserve the proxy for internal operator plumbing where snapshot is never invoked."],"exampleFix":"// before — proxy used as state serializer (will fail on snapshot)\nTypeSerializer<MyType> ser = new SimpleVersionedSerializerTypeSerializerProxy<>(() -> mySimpleSerializer);\nstateDesc.setSerializer(ser);\n\n// after — use a proper TypeSerializer with snapshot support\nTypeSerializer<MyType> ser = new MyTypeSerializer(); // implements snapshotConfiguration()\nstateDesc.setSerializer(ser);","handlingStrategy":"validation","validationCode":"// Do not call snapshotConfiguration() on a proxy.\n// If you need state serializer snapshots, use a full TypeSerializer implementation.","typeGuard":"!(serializer instanceof SimpleVersionedSerializerTypeSerializerProxy)","tryCatchPattern":null,"preventionTips":["Never register a SimpleVersionedSerializerTypeSerializerProxy as a managed-state serializer.","Use the proxy only for internal operator plumbing that never checkpoints its configuration.","Provide a proper TypeSerializer with TypeSerializerSnapshot for state."],"tags":["type-serializer","state-backend","unsupported-operation","api-misuse"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}