pentaho/pentaho-kettle · error · KettleException
FileExists.Exception.CouldnotFindField
Error message
FileExists.Exception.CouldnotFindField
What it means
After checking the configured filename field name is non-empty, FileExists.processRow() looks it up in the previous step's row metadata with indexOfValue(); if the field is not present in the incoming stream, a KettleException with 'CouldnotFindField' plus the field name is thrown on the first row.
Solutions
- Make the incoming stream actually contain a field with exactly the configured name (fix the Select Values/upstream step).
- Correct the 'Filename field' setting to match an existing incoming field (names are case-sensitive).
- Preview the previous step's output to confirm the available field names.
- Re-check hop wiring after refactoring the transformation.
Example fix
// before
meta.setDynamicFilenameField("Filename"); // stream has 'filename' (lowercase)
// after
meta.setDynamicFilenameField("filename"); // matches incoming field exactly Defensive patterns
Strategy: validation
Validate before calling
if (previousRowMeta != null && previousRowMeta.indexOfValue(meta.getDynamicFilenameField()) < 0) {
throw new IllegalStateException("Incoming stream lacks field: " + meta.getDynamicFilenameField());
} Try / catch
try {
trans.execute(null);
} catch (KettleException e) {
if (e.getMessage().contains("FileExists.Exception.CouldnotFindField")) {
// align upstream field names with the configured 'Filename field'
} else { throw e; }
} Prevention
- Preview the upstream step output and match exact (case-sensitive) field names.
- Re-validate mappings after renaming fields upstream.
- Use Select Values to add/rename fields explicitly before FileExists.
- Check hop wiring after transformation refactors.
When it happens
Trigger: The FileExists step's 'Filename field' names a field that does not exist in the rows arriving from the previous step (typo, renamed upstream field, or wrong hop).
Common situations: Upstream step renamed or dropped the field; transformation edited so the hop now comes from a different step; case-sensitive field name mismatch; running after upstream stream changes without re-checking mappings.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- DimOutput: failed to find input row meta for
- PropertyOutput.Log.ErrorFindingField
- StringCut.Exception.FieldRequired
- StringOperations.Exception.FieldRequired
- AnalyticQueryMeta.Exception.SubjectFieldNotFound
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/941bdaf8314d3f71.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExists.java:91
data.NrPrevFields = data.previousRowMeta.size();
data.outputRowMeta = data.previousRowMeta;
meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
metaStore );
// Check is tablename field is provided
if ( Utils.isEmpty( meta.getDynamicFilenameField() ) ) {
logError( BaseMessages.getString( PKG, "FileExists.Error.FilenameFieldMissing" ) );
throw new KettleException( BaseMessages.getString( PKG, "FileExists.Error.FilenameFieldMissing" ) );
}
// cache the position of the field
if ( data.indexOfFileename < 0 ) {
data.indexOfFileename = data.previousRowMeta.indexOfValue( meta.getDynamicFilenameField() );
if ( data.indexOfFileename < 0 ) {
// The field is unreachable !
logError( BaseMessages.getString( PKG, "FileExists.Exception.CouldnotFindField" )
+ "[" + meta.getDynamicFilenameField() + "]" );
throw new KettleException( BaseMessages.getString( PKG, "FileExists.Exception.CouldnotFindField", meta
.getDynamicFilenameField() ) );
}
}
} // End If first
Object[] outputRow = RowDataUtil.allocateRowData( data.outputRowMeta.size() );
for ( int i = 0; i < data.NrPrevFields; i++ ) {
outputRow[i] = r[i];
}
// get filename
String filename = data.previousRowMeta.getString( r, data.indexOfFileename );
if ( !Utils.isEmpty( filename ) ) {
data.file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( filename, getTransMeta() );
// Check if file
fileexists = data.file.exists();
// include file type?View on GitHub (pinned to f3058517a1)