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
- Verify the file exists at the exact path by listing the directory or testing manually.
- Use absolute paths or fix the base folder configuration so relative paths resolve correctly.
- Ensure the executing node has access to the filesystem/network share hosting the file.
- Check that any dynamic filename construction (variables, date patterns) yields the expected name.
- 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
- Use absolute paths or verify the runtime working directory for relative paths.
- Add a 'File exists' filter step so missing files are skipped or logged, not fatal.
- Confirm executing agents mount the same shares as the dev machine.
- Test dynamic filename patterns (dates/variables) against real filenames.
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
- Unable to get zip filename '...' to depth ...
- ZipFile.Error.SourceFileNotFile
- ZipFile.Error.TargetParentFolderNotExists
- Can not append to an existing zip file
- Error opening new file
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)