pentaho/pentaho-kettle · error · KettleException

GPload.Exception.DataFileMissing

Error message

GPload.Exception.DataFileMissing

What it means

GPLoadDataOutput.open() validates the data file path from the step metadata before creating the load file. It throws this KettleException when the configured 'data file' is empty or null (both before and after variable substitution). The GPload step needs a file to buffer rows before invoking the gpload utility.

Solutions

  1. Open the GPload step dialog and set the 'Data file' field to a valid absolute path
  2. Define the variable used in the data file path (set it in kettle.properties or as a transformation parameter) so environmentSubstitute() resolves it non-empty
  3. Inspect the saved .ktr XML for an empty <data_file> element and fix the metadata
  4. Check the repository-saved step attributes and re-save the step with a data file

Example fix

// before (kettle.xml snippet)
<data_file/>
// after
<data_file>/tmp/gpload_data.txt</data_file>
Defensive patterns

Strategy: validation

Validate before calling

String dataFile = meta.getDataFile();
if (dataFile == null || dataFile.trim().isEmpty()
    || dataFile.trim().replace("${", "").equals(dataFile) == false && dataFile.contains("${") ) {
  throw new IllegalStateException("GPload data file must be set to a concrete path or resolvable variable");
}

Type guard

boolean hasDataFile(GPLoadMeta m) { String d = m.getDataFile(); return d != null && !d.trim().isEmpty(); }

Try / catch

try { gpLoad.init(...); } catch (KettleException e) { if (e.getMessage().contains("DataFileMissing")) { /* prompt user / set default path and retry */ } else throw e; }

Prevention

When it happens

Trigger: open() is called (from getFields/getOutputFields/check/readFile paths) while meta.getDataFile() returns null/empty, or after space.environmentSubstitute() the substituted value resolves to empty (e.g. a variable like ${DATAFILE} that is undefined).

Common situations: Step saved without filling the 'Data file' field; ${DATAFILE} environment variable/parameter undefined at runtime; XML or repository metadata lost the datafile attribute after a migration or hand-edited ktr.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

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

    log = new LogChannel( this );
    log.setLogLevel( logLevel );
  }

  public void open( VariableSpace space, Process sqlldrProcess ) throws KettleException {
    // String loadMethod = meta.getLoadMethod();
    try {
      OutputStream os = null;

      // if ( GPLoadMeta.METHOD_AUTO_CONCURRENT.equals(loadMethod)) {
      // String dataFile = meta.getControlFile();
      // dataFile = StringUtil.environmentSubstitute(dataFile);
      // os = new FileOutputStream(dataFile, true);
      // } else {
      // Else open the data file filled in.

      String dataFile = meta.getDataFile();
      if ( Utils.isEmpty( dataFile ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "GPload.Exception.DataFileMissing" ) );
      }

      dataFile = space.environmentSubstitute( dataFile );
      if ( Utils.isEmpty( dataFile ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "GPload.Exception.DataFileMissing" ) );
      }

      log.logDetailed( "Creating temporary load file " + 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 ) ) );

View on GitHub (pinned to f3058517a1)