pentaho/pentaho-kettle · error · KettleException
ZipFile.Error.TargetFilenameFieldMissing
Error message
ZipFile.Error.TargetFilenameFieldMissing
What it means
Thrown in ZipFile.processRow() when the 'target filename field' (the name of the .zip file to create, taken from a stream field) is not configured. Mirrors the source-field check immediately after it: both dynamic fields are mandatory for the step to operate.
Solutions
- Open the Zip File step dialog and set the 'Target filename fieldname' to an incoming String field holding the zip path.
- Confirm the upstream step provides that field and the name matches exactly (case-sensitive).
- Re-open and re-save the step if metadata was migrated and the attribute went missing.
- Validate the transformation XML/repository entry includes the target filename field attribute before execution.
Example fix
// before: only source field configured zipFileMeta.setDynamicSourceFileNameField( "filename" ); zipFileMeta.setDynamicTargetFileNameField( null ); // after: configure both required fields zipFileMeta.setDynamicSourceFileNameField( "filename" ); zipFileMeta.setDynamicTargetFileNameField( "zip_filename" );
Defensive patterns
Strategy: validation
Validate before calling
if ( Utils.isEmpty( zipFileMeta.getDynamicTargetFileNameField() ) ) {
throw new KettleException( "Zip File step requires 'Target filename fieldname' to be set" );
} Try / catch
try {
trans.execute( null );
} catch ( KettleException e ) {
if ( e.getMessage() != null && e.getMessage().contains( "TargetFilenameFieldMissing" ) ) {
logError( "Configure the Zip File step's target (zip) filename field and re-run", e );
}
} Prevention
- Configure source and target fields together, never one without the other.
- Confirm the upstream step emits a field holding the zip output path.
- Run a design-time preview to surface missing configuration before scheduling.
- Document required upstream fields for the step in your transformation template.
When it happens
Trigger: First processRow() call: source filename field passes the check, but meta.getDynamicTargetFileNameField() is null/empty, raising 'ZipFile.Error.TargetFilenameFieldMissing'.
Common situations: Zip File step saved without 'Target filename fieldname' selected, metadata lost during copy/migration of step XML, field setting cleared by a script or template that only set the source field.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- ZipFile.Error.SourceFilenameFieldMissing
- ColumnExists.Error.ColumnnameFieldMissing
- ColumnExists.Error.TablenameFieldMissing
- JobSQL.NoSQLFileSpecified
- SymmetricCryptoTrans.Exception.MissingMessageField
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/84d9e14c3b7cd15f.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFile.java:90
setOutputDone();
return false;
}
if ( first ) {
first = false;
data.outputRowMeta = getInputRowMeta().clone();
meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this,
getTrans().getRepository(), getTrans().getMetaStore() );
// Check is source filename field is provided
if ( Utils.isEmpty( meta.getDynamicSourceFileNameField() ) ) {
throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Error.SourceFilenameFieldMissing" ) );
}
// Check is target filename field is provided
if ( Utils.isEmpty( meta.getDynamicTargetFileNameField() ) ) {
throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Error.TargetFilenameFieldMissing" ) );
}
// cache the position of the source filename field
if ( data.indexOfSourceFilename < 0 ) {
data.indexOfSourceFilename = getInputRowMeta().indexOfValue( meta.getDynamicSourceFileNameField() );
if ( data.indexOfSourceFilename < 0 ) {
// The field is unreachable !
throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Exception.CouldnotFindField", meta
.getDynamicSourceFileNameField() ) );
}
}
data.indexOfZipFilename = getInputRowMeta().indexOfValue( meta.getDynamicTargetFileNameField() );
if ( data.indexOfZipFilename < 0 ) {
// The field is unreachable !
throw new KettleException( BaseMessages.getString( PKG, "ZipFile.Exception.CouldnotFindField", meta
.getDynamicTargetFileNameField() ) );
}View on GitHub (pinned to f3058517a1)