{"record":{"id":"e1f6e9de7f8bef91","repo":"apache/hadoop","slug":"stream-data-required","errorCode":null,"errorMessage":"Stream data required","messagePattern":"Stream data required","errorType":"validation","errorClass":"InvalidObjectException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawPathHandle.java","lineNumber":116,"sourceCode":"      fd.slice().get(x);\n      out.write(x);\n    }\n  }\n\n  private void readObject(ObjectInputStream in)\n      throws IOException, ClassNotFoundException {\n    in.defaultReadObject();\n    int len = in.readInt();\n    if (len < 0 || len > MAX_SIZE) {\n      throw new IOException(\"Illegal buffer length \" + len);\n    }\n    byte[] x = new byte[len];\n    in.readFully(x);\n    fd = ByteBuffer.wrap(x);\n  }\n\n  private void readObjectNoData() throws ObjectStreamException {\n    throw new InvalidObjectException(\"Stream data required\");\n  }\n\n}\n","sourceCodeStart":98,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawPathHandle.java#L98-L120","documentation":"Thrown from RawPathHandle.readObjectNoData with InvalidObjectException when the Java serialization runtime initializes a RawPathHandle from a stream that contains the class descriptor but no object data (for example when readObject encounters the class in a stream where the instance fields were never written, or class-data reconciliation leaves no payload). RawPathHandle's fd is transient and must be rebuilt from stream bytes; an instance with no stream data is invalid, so construction is refused.","triggerScenarios":"Deserializing an object graph where a RawPathHandle placeholder was written by a different class shape (stream class-data mismatch), or reflective tricks that trigger readObjectNoData (e.g., deserialize with a superclass/subclass swap).","commonSituations":"Version skew between the JVM that serialized the handle and the one deserializing it after RawPathHandle was recompiled with changed inheritance; corrupt or hand-crafted object streams.","solutions":["Re-create the handle from the source FileSystem instead of deserializing the stale object","Pin matching Hadoop versions on both ends of the serialization boundary","Catch InvalidObjectException/ObjectStreamException and fall back to path-based access"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try (ObjectInputStream in = new ObjectInputStream(src)) {\n  handle = (PathHandle) in.readObject();\n} catch (InvalidObjectException | ObjectStreamException e) {\n  // \"Stream data required\" -> class/stream shape mismatch; refetch handle\n  handle = fs.getPathHandle(fs.getFileStatus(p));\n}","preventionTips":["Keep Hadoop versions identical across the serialization boundary","Prefer re-creating PathHandles from the source FileSystem over persisting Java-serialized handle objects"],"tags":["hadoop","pathhandle","deserialization","corruption"],"backgroundTag":"deserialization-payload-validation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}