{"record":{"id":"5166739996d65d16","repo":"pentaho/pentaho-kettle","slug":"error-while-closing-output-gpload","errorCode":null,"errorMessage":"Error while closing output","messagePattern":"Error while closing output","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java","lineNumber":582,"sourceCode":"  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n    meta = (GPLoadMeta) smi;\n    data = (GPLoadData) sdi;\n\n    try {\n      Object[] r = getRow(); // Get row from input rowset & set row busy!\n      // no more input to be expected...\n      if ( r == null ) {\n        setOutputDone();\n\n        if ( !preview ) {\n          if ( output != null ) {\n            // Close the output\n            try {\n              output.close();\n            } catch ( IOException e ) {\n              throw new KettleException( \"Error while closing output\", e );\n            }\n\n            output = null;\n          }\n\n          String loadMethod = meta.getLoadMethod();\n\n          // if it specified that we are to load at the end of processing\n          if ( GPLoadMeta.METHOD_AUTO_END.equals( loadMethod ) ) {\n\n            // if we actually wrote at least one row\n            if ( getLinesOutput() > 0 ) {\n\n              // we do this\n              createControlFile( meta );\n              execute( meta, true );\n            } else {\n              // we don't create a control file and execute","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java#L564-L600","documentation":"processRow() closes the BufferedWriter used to stream data to gpload's stdin and, if output.close() throws IOException, wraps it in a KettleException with message 'Error while closing output'. It indicates the stream/pipe to the gpload process broke during close.","triggerScenarios":"output.close() throws IOException - typically because the gpload process has already died and closed its stdin, breaking the pipe, or an underlying file/stream error occurred.","commonSituations":"gpload crashed mid-load so the pipe is broken; disk full for file-based load method; process killed by OOM or timeout; NFS I/O errors.","solutions":["Look earlier in the log for the real gpload failure that killed the process and fix that.","Free disk space or fix filesystem issues if the load method writes a data file.","Ensure the gpload process stays healthy (memory limits, permissions) so it consumes stdin until completion.","Retry the transformation after correcting the upstream cause."],"exampleFix":"// diagnostics\n# check disk space on data-file volume\ndf -h /var/pentaho/gpload_out\n// ensure gpload still running while streaming\nps -ef | grep gpload","handlingStrategy":"try-catch","validationCode":"File dataDir = new File(\"/var/pentaho/gpload_out\");\nif (dataDir.getUsableSpace() < 100L * 1024 * 1024) {\n  throw new IllegalStateException(\"Insufficient disk space for gpload data files\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  execute();\n} catch (KettleException ke) {\n  if (ke.getMessage().contains(\"Error while closing output\")) {\n    logError(\"Output stream broke; gpload process likely died earlier - check prior log lines\", ke);\n  }\n  throw ke;\n}","preventionTips":["Monitor disk space on the volume holding gpload data/control files","Investigate earlier gpload process deaths before treating close errors as primary","Watch process/memory limits so gpload is not OOM-killed mid-load"],"tags":["pdi","kettle","gpload","io-exception","broken-pipe"],"backgroundTag":"broken-pipe","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}