{"record":{"id":"a672f3c6a66955fb","repo":"apache/hadoop","slug":"output-buffer-not-set","errorCode":null,"errorMessage":"output buffer not set","messagePattern":"output buffer not set","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/java/org/apache/hadoop/mapred/nativetask/handlers/BufferPullee.java","lineNumber":70,"sourceCode":"    this.rIter = rIter;\n    tmpInputKey = new SizedWritable<IK>(iKClass);\n    tmpInputValue = new SizedWritable<IV>(iVClass);\n\n    if (null != iKClass && null != iVClass) {\n      this.serializer = new KVSerializer<IK, IV>(iKClass, iVClass);\n    }\n    this.outputBuffer = target.getOutputBuffer();\n    this.target = target;\n  }\n\n  @Override\n  public int load() throws IOException {\n    if (closed) {\n      return 0;\n    }\n    \n    if (null == outputBuffer) {\n      throw new IOException(\"output buffer not set\");\n    }\n\n    this.nativeWriter = new ByteBufferDataWriter(target);\n    outputBuffer.rewind();\n\n    int written = 0;\n    boolean firstKV = true;\n\n    if (inputKVBufferd) {\n      written += serializer.serializeKV(nativeWriter, tmpInputKey, tmpInputValue);\n      inputKVBufferd = false;\n      firstKV = false;\n    }\n\n    while (rIter.next()) {\n      inputKVBufferd = false;\n      tmpInputKey.readFields(rIter.getKey());\n      tmpInputValue.readFields(rIter.getValue());","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/java/org/apache/hadoop/mapred/nativetask/handlers/BufferPullee.java#L52-L88","documentation":"BufferPullee (reduce-side native buffer consumer) obtains its output buffer from target.getOutputBuffer() at construction; load() refuses to run when that buffer is null and throws IOException('output buffer not set'). It means the downstream target handler never initialized its native output buffer before a pull was attempted - an internal wiring/initialization-order defect in the nativetask data path rather than a user configuration issue.","triggerScenarios":"Constructing a BufferPullee against a target whose native handler was not initialized (init not called, or createNativeObject failed silently earlier), then calling load(); also after close() interplay if the target was rebuilt without re-acquiring the buffer.","commonSituations":"Developing custom nativetask platforms/handlers and wiring pull/push pipelines by hand; version drift where the target handler implementation stopped publishing an output buffer.","solutions":["Ensure the target handler is fully initialized (native object created, init(conf) run) before constructing or using the BufferPullee","Null-check target.getOutputBuffer() during wiring and fail with context on which handler lacks a buffer","If using stock handlers only, check for jar/so version mismatch and realign the installation"],"exampleFix":"// before\nBufferPullee pullee = new BufferPullee(target);\npullee.load(); // IOException if target had no output buffer\n\n// after\nif (target.getOutputBuffer() == null) {\n  throw new IOException(\"target \" + target.getClass().getName() + \" has no output buffer; init it first\");\n}\npullee.load();","handlingStrategy":"try-catch","validationCode":"if (target.getOutputBuffer() == null) {\n  throw new IllegalStateException(\n      \"target \" + target.getClass().getSimpleName() + \" not initialized: no output buffer\");\n}\npullee.load();","typeGuard":null,"tryCatchPattern":"try {\n  int written = pullee.load();\n} catch (IOException e) {\n  if (\"output buffer not set\".equals(e.getMessage())) {\n    // wiring bug: re-init target handler and rebuild the pullee before retrying\n  }\n  throw e;\n}","preventionTips":["Initialize target handlers (native object + init(conf)) before constructing BufferPullee","Assert non-null output buffers during pipeline wiring in platform unit tests","Treat this message as an internal-api contract violation, not a cluster config issue"],"tags":["nativetask","buffer-management","initialization","internal-api"],"backgroundTag":"uninitialized-buffer-handoff","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}