pentaho/pentaho-kettle · error · KettleException
LDIFInput.Exception.CouldnotFindField
LDIFInput.Exception.CouldnotFindField
Error message
LDIFInput.Exception.CouldnotFindField
What it means
LDIFInput.openNextFile throws this when the configured dynamic filename field cannot be found in the input row metadata (indexOfValue returns -1). The field name set in the step config does not exist among the fields arriving from the previous step.
Solutions
- Verify the exact field name (case-sensitive) exists in the previous step's output via a Preview/Get Fields.
- Update the LDIF Input 'filename field' setting to match the upstream field name exactly.
- Re-run 'Get Fields' on the upstream step and reselect the field.
- Ensure the correct hop/step feeds the LDIF Input step.
Example fix
// before // dynamicFilenameField = "file_name" // upstream output field: "fileName" // after // dynamicFilenameField = "fileName" (matches upstream exactly)
Defensive patterns
Strategy: validation
Validate before calling
RowMetaInterface in = transMeta.getPrevStepFields(ldifStep);
if (in.indexOfValue(meta.getDynamicFilenameField()) < 0) {
throw new IllegalStateException("Field not produced upstream: " + meta.getDynamicFilenameField());
} Try / catch
try {
trans.execute(null);
} catch (KettleException e) {
if (e.getMessage().contains("CouldnotFindField")) {
log.error("Filename field not in input rows; check upstream step fields");
}
} Prevention
- Match field names case-sensitively to upstream output
- Re-run 'Get Fields' after editing upstream steps
- Preview upstream rows before wiring file-input steps
When it happens
Trigger: meta.getDynamicFilenameField() is non-empty, but getInputRowMeta().indexOfValue(field) < 0 when openNextFile processes the first row.
Common situations: Upstream step renamed or removed the field; case mismatch in field name; transformation edited so the field is no longer produced; wrong step wired as input.
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
- LDIFInput.Log.NoField
- LoadFileInput.Exception.CouldnotFindField
- AddSequence.Exception.NoSpecifiedMethod
- BaseStep.Exception.SourceStepToReadFromCantRunInMultipleCopies
- BaseStep.Exception.TargetStepToWriteToCantRunInMultipleCopies
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/d8ae28a8a6ecd7af.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/ldifinput/LDIFInput.java:328
data.totalpreviousfields = data.inputRowMeta.size();
// Create convert meta-data objects that will contain Date & Number formatters
data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );
// Check is filename field is provided
if ( Utils.isEmpty( meta.getDynamicFilenameField() ) ) {
logError( BaseMessages.getString( PKG, "LDIFInput.Log.NoField" ) );
throw new KettleException( BaseMessages.getString( PKG, "LDIFInput.Log.NoField" ) );
}
// cache the position of the field
if ( data.indexOfFilenameField < 0 ) {
data.indexOfFilenameField = getInputRowMeta().indexOfValue( meta.getDynamicFilenameField() );
if ( data.indexOfFilenameField < 0 ) {
// The field is unreachable !
logError( BaseMessages.getString( PKG, "LDIFInput.Log.ErrorFindingField" )
+ "[" + meta.getDynamicFilenameField() + "]" );
throw new KettleException( BaseMessages.getString(
PKG, "LDIFInput.Exception.CouldnotFindField", meta.getDynamicFilenameField() ) );
}
}
} // End if first
String filename = environmentSubstitute( getInputRowMeta().getString( data.readrow, data.indexOfFilenameField ) );
if ( isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "LDIFInput.Log.FilenameInStream", meta
.getDynamicFilenameField(), filename ) );
}
data.file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( filename, getTransMeta() );
}
data.filename = KettleVFS.getFilename( data.file );
// Add additional fields?
if ( meta.getShortFileNameField() != null && meta.getShortFileNameField().length() > 0 ) {
data.shortFilename = data.file.getName().getBaseName();
}View on GitHub (pinned to f3058517a1)