{"record":{"id":"7817095ee274cd01","repo":"apache/flink","slug":"user-defined-object-contains-non-serializa","errorCode":null,"errorMessage":"User-defined object {} ({}) contains non-serializable field {} = {}","messagePattern":"User-defined object (.+?) \\((.+?)\\) contains non-serializable field (.+?) = (.+?)","errorType":"validation","errorClass":"NonSerializableUserCodeException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/common/operators/util/UserCodeObjectWrapper.java","lineNumber":95,"sourceCode":"                }\n\n                for (Field f : current.getClass().getDeclaredFields()) {\n                    f.setAccessible(true);\n\n                    if (f.getName().contains(\"$outer\")) {\n                        newCurrent = f.get(current);\n                    }\n\n                    if (hasCustomSerialization\n                            || Modifier.isTransient(f.getModifiers())\n                            || Modifier.isStatic(f.getModifiers())) {\n                        // field not relevant for serialization\n                        continue;\n                    }\n\n                    Object fieldContents = f.get(current);\n                    if (fieldContents != null && !(fieldContents instanceof Serializable)) {\n                        throw new NonSerializableUserCodeException(\n                                \"User-defined object \"\n                                        + userCodeObject\n                                        + \" (\"\n                                        + userCodeObject.getClass().getName()\n                                        + \") contains non-serializable field \"\n                                        + f.getName()\n                                        + \" = \"\n                                        + f.get(current));\n                    }\n                }\n                current = newCurrent;\n            }\n        } catch (NonSerializableUserCodeException e) {\n            // forward those\n            throw e;\n        } catch (Exception e) {\n            // should never happen, since we make the fields accessible.\n            // anyways, do not swallow the exception, but report it","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/operators/util/UserCodeObjectWrapper.java#L77-L113","documentation":"Error \"User-defined object {} ({}) contains non-serializable field {} = {}\" thrown in apache/flink.","triggerScenarios":"Triggered at runtime when the operation fails because: User-defined object the reported value (the reported value) contains non-serializable field the reported value = the reported value.","commonSituations":"Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: User-defined object the reported value (the reported value) contains non-serializable field the reported value = the reported value.","solutions":["Address the cause reported by the error message: User-defined object the reported value (the reported value) contains non-serializable field the reported value = the reported value","Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry."],"exampleFix":"Correct the condition described (\"User-defined object the reported value (the reported value) contains non-serializable field the reported value = the reported value\") and rerun the job or command.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}