pentaho/pentaho-kettle · error · KettleException

Error while closing output

Error message

Error while closing output

What it means

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.

Solutions

  1. Look earlier in the log for the real gpload failure that killed the process and fix that.
  2. Free disk space or fix filesystem issues if the load method writes a data file.
  3. Ensure the gpload process stays healthy (memory limits, permissions) so it consumes stdin until completion.
  4. Retry the transformation after correcting the upstream cause.

Example fix

// diagnostics
# check disk space on data-file volume
df -h /var/pentaho/gpload_out
// ensure gpload still running while streaming
ps -ef | grep gpload
Defensive patterns

Strategy: try-catch

Validate before calling

File dataDir = new File("/var/pentaho/gpload_out");
if (dataDir.getUsableSpace() < 100L * 1024 * 1024) {
  throw new IllegalStateException("Insufficient disk space for gpload data files");
}

Try / catch

try {
  execute();
} catch (KettleException ke) {
  if (ke.getMessage().contains("Error while closing output")) {
    logError("Output stream broke; gpload process likely died earlier - check prior log lines", ke);
  }
  throw ke;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/5166739996d65d16. Report an issue: GitHub.

Appendix: source

Thrown at plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoad.java:582

  }

  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
    meta = (GPLoadMeta) smi;
    data = (GPLoadData) sdi;

    try {
      Object[] r = getRow(); // Get row from input rowset & set row busy!
      // no more input to be expected...
      if ( r == null ) {
        setOutputDone();

        if ( !preview ) {
          if ( output != null ) {
            // Close the output
            try {
              output.close();
            } catch ( IOException e ) {
              throw new KettleException( "Error while closing output", e );
            }

            output = null;
          }

          String loadMethod = meta.getLoadMethod();

          // if it specified that we are to load at the end of processing
          if ( GPLoadMeta.METHOD_AUTO_END.equals( loadMethod ) ) {

            // if we actually wrote at least one row
            if ( getLinesOutput() > 0 ) {

              // we do this
              createControlFile( meta );
              execute( meta, true );
            } else {
              // we don't create a control file and execute

View on GitHub (pinned to f3058517a1)