pentaho/pentaho-kettle · error · KettleException

IO exception occured:

Error message

IO exception occured: 

What it means

GPBulkDataOutput.open wraps any IOException raised while opening the bulk data output file for the Greenplum bulk loader into a KettleException prefixed with 'IO exception occured: '. The PrintWriter/OutputStreamWriter around the file's OutputStream cannot be constructed, typically because the file or encoding is unusable.

Solutions

  1. Check the nested IOException message — it names the missing directory, permission problem, or unsupported encoding.
  2. Create the output directory and grant the Pentaho process write permission.
  3. Correct the file name/path in the step's data file setting.
  4. Set a valid encoding (e.g. 'UTF-8') in the step dialog.

Example fix

// before: invalid encoding and missing directory
encoding = "utf-88"; // UnsupportedEncodingException -> IOException
filename = "/nonexistent/dir/data.txt";

// after
encoding = "UTF-8";
filename = "/opt/pentaho/gpload/data.txt"; // directory exists and is writable
Defensive patterns

Strategy: validation

Validate before calling

File f = new File( dataFile );
if ( !f.getParentFile().exists() || !f.getParentFile().canWrite() ) {
  throw new KettleException( "Data file directory missing or not writable: " + f.getParent() );
}
Charset.forName( encoding ); // throws if encoding name is invalid

Prevention

When it happens

Trigger: Calling open() during step initialization when the target data file cannot be written: directory does not exist, no write permission, filename invalid, or the configured encoding is not a supported charset name.

Common situations: Output directory missing or mounted read-only; filename pointing to a location the Pentaho user cannot write; typo in the character encoding name (e.g. 'UTF8 ' with a space or 'utf-88'); gpfdist data file path configured on a remote host where the local process has no filesystem access.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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

Appendix: source

Thrown at plugins/gp-bulk-loader/core/src/main/java/org/pentaho/di/trans/steps/gpbulkloader/GPBulkDataOutput.java:86

      // else
      // {
      // Else open the data file filled in.
      String dataFile = meta.getDataFile();
      dataFile = space.environmentSubstitute( dataFile );

      os = new FileOutputStream( dataFile, false );
      // }

      String encoding = meta.getEncoding();
      if ( Utils.isEmpty( encoding ) ) {
        // Use the default encoding.
        output = new PrintWriter( new BufferedWriter( new OutputStreamWriter( os ) ) );
      } else {
        // Use the specified encoding
        output = new PrintWriter( new BufferedWriter( new OutputStreamWriter( os, encoding ) ) );
      }
    } catch ( IOException e ) {
      throw new KettleException( "IO exception occured: " + e.getMessage(), e );
    }
  }

  public void close() throws IOException {
    if ( output != null ) {
      output.close();
    }
  }

  PrintWriter getOutput() {
    return output;
  }

  private String createEscapedString( String orig, String enclosure ) {
    StringBuffer buf = new StringBuffer( orig );

    Const.repl( buf, enclosure, enclosure + enclosure );
    return buf.toString();

View on GitHub (pinned to f3058517a1)