pentaho/pentaho-kettle · error · KettleException

Following required files are missing

Error message

Following required files are missing: {message}

What it means

The TextFileInput step constructor validates that all files matched by the input specification exist. If some required files are missing and 'Ignore missing files' (meta.isErrorIgnored) is not enabled, it aborts initialization with 'Following required files are missing: <list>'.

Solutions

  1. Check the listed file paths for typos and verify each exists at run time.
  2. Enable 'Ignore missing files' in the step (or handleNonExistantFile error handling) if absence is acceptable.
  3. Use variables/parameters for paths and verify they resolve correctly in the execution environment.
  4. Add a pre-step 'Check if files exist' job entry or file-exists validation before the transformation.

Example fix

// before: ${INPUT_DIR}/data_*.csv matches nothing because INPUT_DIR is unset/typo
// after: define and validate the variable, or tolerate missing files
//   Internal.Step set parameter INPUT_DIR=/data/incoming
//   OR in step settings check: 'Ignore missing files' (meta.setErrorIgnored(true))
Defensive patterns

Strategy: validation

Validate before calling

// Verify every matched file exists before launching the transformation
File dir = new File(inputDir);
File[] matched = dir.listFiles((d, n) -> n.matches("data_.*\\.csv"));
if (matched == null || matched.length < expectedMinFiles) {
  throw new IllegalStateException("Missing input files in " + inputDir);
}
for (File f : matched) if (!f.isFile()) throw new IllegalStateException("Not a file: " + f);

Try / catch

try {
  initStep(inputFiles);
} catch (KettleException e) {
  if (e.getMessage().startsWith("Following required files are missing")) {
    alertOps(e.getMessage()); // includes the exact missing file list
  }
  throw e;
}

Prevention

When it happens

Trigger: A wildcard/glob or explicit filename list matched files that do not exist at transformation start, with error-ignored disabled in the step's settings.

Common situations: Typos in file paths, upstream job failed to produce expected files, relative paths resolved from a different working directory, files deleted between scheduling and run time.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/textfileinput/TextFileInput.java:1292

    }

    return filterOK;
  }

  private void handleMissingFiles() throws KettleException {
    List<FileObject> nonExistantFiles = data.getFiles().getNonExistantFiles();

    if ( nonExistantFiles.size() != 0 ) {
      String message = FileInputList.getRequiredFilesDescription( nonExistantFiles );
      if ( log.isBasic() ) {
        log.logBasic( "Required files", "WARNING: Missing " + message );
      }
      if ( meta.isErrorIgnored() ) {
        for ( FileObject fileObject : nonExistantFiles ) {
          data.dataErrorLineHandler.handleNonExistantFile( fileObject );
        }
      } else {
        throw new KettleException( "Following required files are missing: " + message );
      }
    }

    List<FileObject> nonAccessibleFiles = data.getFiles().getNonAccessibleFiles();
    if ( nonAccessibleFiles.size() != 0 ) {
      String message = FileInputList.getRequiredFilesDescription( nonAccessibleFiles );
      if ( log.isBasic() ) {
        log.logBasic( "Required files", "WARNING: Not accessible " + message );
      }
      if ( meta.isErrorIgnored() ) {
        for ( FileObject fileObject : nonAccessibleFiles ) {
          data.dataErrorLineHandler.handleNonAccessibleFile( fileObject );
        }
      } else {
        throw new KettleException( "Following required files are not accessible: " + message );
      }
    }
  }

View on GitHub (pinned to f3058517a1)