pentaho/pentaho-kettle · error · KettleException

ZipFile.Error.SourceFileNotExist

Error message

ZipFile.Error.SourceFileNotExist

What it means

The source filename from the row points to a path that does not exist on the filesystem at execution time. The step resolves the path via KettleVFS, checks FileObject.exists(), and throws this KettleException (after logging) because it cannot zip a nonexistent file.

Solutions

  1. Verify the file exists at the exact path by listing the directory or testing manually.
  2. Use absolute paths or fix the base folder configuration so relative paths resolve correctly.
  3. Ensure the executing node has access to the filesystem/network share hosting the file.
  4. Check that any dynamic filename construction (variables, date patterns) yields the expected name.
  5. Pre-filter rows with a 'File exists' check step to skip missing files gracefully.

Example fix

// before
String f = "data/export_" + yesterday + ".csv"; // pattern mismatch -> file missing
// after
String f = "data/export_" + DateTimeUtil.today() + ".csv"; // or verify with File exists step
Defensive patterns

Strategy: validation

Validate before calling

// Upstream 'File exists' check step or Java check:
File f = new File(sourceFilename);
if (!f.exists()) {
  // route row to an error stream / log instead of zipping
}

Try / catch

try {
  transformation.execute();
} catch (KettleException e) {
  if (e.getMessage() != null && e.getMessage().contains("SourceFileNotExist")) {
    log.error("ZipFile source file missing: check path, working dir, and mounts", e);
  } else { throw e; }
}

Prevention

When it happens

Trigger: data.sourceFile.exists() returns false for the path taken from the row's source filename field at ZipFile.java:157.

Common situations: File deleted or moved between an earlier step and ZipFile; relative path resolved against a different working directory than expected; filename contains typos, wrong case (Linux), or stale date-pattern substitution (e.g., ${TODAY} format mismatch); agent/worker runs on a node lacking the shared mount.

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/ccd19b72072fbafe. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java:157

    try {
      // get source filename
      String sourceFilename = getInputRowMeta().getString( r, data.indexOfSourceFilename );

      if ( Utils.isEmpty( sourceFilename ) ) {
        log.logError( toString(), BaseMessages.getString( PKG, "ZipFile.Error.SourceFileEmpty" ) );
        throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Error.SourceFileEmpty" ) );
      }
      data.sourceFile = KettleVFS.getInstance( getTransMeta().getBowl() )
        .getFileObject( sourceFilename, this );

      // Check sourcefile
      boolean skip = false;
      if ( !data.sourceFile.exists() ) {
        log
          .logError( toString(), BaseMessages
            .getString( PKG, "ZipFile.Error.SourceFileNotExist", sourceFilename ) );
        throw new KettleException( BaseMessages
          .getString( PKG, "ZipFile.Error.SourceFileNotExist", sourceFilename ) );
      } else {
        if ( data.sourceFile.getType() != FileType.FILE ) {
          log.logError( toString(), BaseMessages
            .getString( PKG, "ZipFile.Error.SourceFileNotFile", sourceFilename ) );
          throw new KettleException( BaseMessages.getString(
            PKG, "ZipFile.Error.SourceFileNotFile", sourceFilename ) );
        }
      }

      // get basefolder
      if ( data.indexOfBaseFolder > -1 ) {
        data.baseFolder = getInputRowMeta().getString( r, data.indexOfBaseFolder );
      }

      // get destination folder
      String moveToFolder = null;
      if ( data.indexOfMoveToFolder > -1 ) {

View on GitHub (pinned to f3058517a1)