pentaho/pentaho-kettle · error · KettleException
ZipFile.Error.SourceFileEmpty
Error message
ZipFile.Error.SourceFileEmpty
What it means
The source filename read from the current row is null or empty, so there is no file to zip. The step logs 'ZipFile.Error.SourceFileEmpty' and throws a KettleException, aborting processing of that row because zipping an unnamed file is meaningless.
Solutions
- Fix the upstream step so it always populates the source filename field before ZipFile.
- Insert a Filter rows step to route rows with empty filenames to a separate stream or log.
- Use a 'Value Mapper' or 'If field value is null' / NVL-like step to supply a default or skip.
- Verify the correct field is selected as the source filename in the ZipFile dialog.
Example fix
// before: rows flow straight into ZipFile with possibly null filename // after: add Filter rows step // filter: sourceFilename IS NOT NULL AND sourceFilename != ""
Defensive patterns
Strategy: validation
Validate before calling
// In an upstream 'Filter rows' or user-defined Java expression: // condition: sourceFilename IS NOT NULL AND TRIM(sourceFilename) <> ""
Try / catch
try {
transformation.execute();
} catch (KettleException e) {
if (e.getMessage() != null && e.getMessage().contains("SourceFileEmpty")) {
log.warn("Row skipped: empty source filename - fix upstream data", e);
} else { throw e; }
} Prevention
- Filter or default empty filename values upstream of ZipFile.
- Use NVL/default-value steps on fields sourced from lookups or text inputs.
- Preview data at the ZipFile input hop to catch nulls early.
When it happens
Trigger: getInputRowMeta().getString(r, data.indexOfSourceFilename) returns null/empty string for the source filename field at ZipFile.java:146.
Common situations: Upstream step emitted a row with a null filename (e.g., a table lookup returned NULL); an input text file had a short/blank line; a filter or join produced empty filename values; wrong field selected so an unrelated empty column is read.
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
- ZipFile.Error.EmptyMoveToFolder
- ZipFile.Error.TargetFileEmpty
- Can not append to an existing zip file
- ZipFile.Error.SourceFileNotExist
- ZipFile.Error.SourceFileNotFile
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/672fc4b0b0c3877b.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java:146
if ( data.indexOfMoveToFolder < 0 ) {
// The field is unreachable !
throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Exception.CouldnotFindField", meta
.getMoveToFolderField() ) );
}
}
} // End If first
boolean sendToErrorRow = false;
String errorMessage = null;
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 ) );View on GitHub (pinned to f3058517a1)