pentaho/pentaho-kettle · error · KettleException
MailInput.Error.ReceivedDatesSearchTermEmpty
MailInput.Error.ReceivedDatesSearchTermEmpty
Error message
MailInput.Error.ReceivedDatesSearchTermEmpty
What it means
For the BETWEEN condition, init() requires both start and end received dates. This key is thrown when the FIRST date of the between range (ReceivedDate1) is empty. The library cannot build a between-range search term without a lower bound.
Solutions
- Fill in the begin date for the between condition in the step dialog
- Ensure the variable used for the start date is defined in the runtime environment (kettle.properties, parameter)
- Switch the condition to equal/greater/smaller if only one bound is intended
- Validate step settings in the dialog before saving the transformation
Example fix
// before
realBeginDate = environmentSubstitute( meta.getReceivedDate1() ); // empty -> throws
// after
String realBeginDate = environmentSubstitute( meta.getReceivedDate1() );
if ( Utils.isEmpty( realBeginDate ) ) {
throw new KettleException( "Received date 'from' must be set for BETWEEN condition" ); // fail at design time
} Defensive patterns
Strategy: validation
Validate before calling
if ( meta.getConditionOnReceivedDate() == MailConnectionMeta.CONDITION_DATE_BETWEEN
&& Utils.isEmpty( environmentSubstitute( meta.getReceivedDate1() ) ) ) {
throw new IllegalArgumentException( "BETWEEN requires a begin received date" );
} Try / catch
try {
init();
} catch ( KettleException e ) {
logError( "MailInput init failed (between begin date): " + e.getMessage() );
setErrors( 1 );
} Prevention
- Fill both bounds whenever BETWEEN is selected
- Define the start-date variable in the runtime environment
- Add design-time validation in custom wrapping metadata
When it happens
Trigger: MailInput step with 'Condition on received date' = between, and the begin-date field (ReceivedDate1) blank or a variable resolving to empty at init time.
Common situations: Undefined environment variable feeding the start date; user filled only the end date; step exported/imported without the begin date value.
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
- MailInput.Error.ReceivedDateSearchTermEmpty
- ColumnExists.Error.TablenameFieldMissing
- DynamicSQLRow.Exception.SQLFieldNameEmpty
- Error adding values to row!
- ERROR0014
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/f62a0a2068b487d7.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/email-messages/impl/src/main/java/org/pentaho/di/trans/steps/mailinput/MailInput.java:429
// Received Date
try {
String realBeginDate;
switch ( meta.getConditionOnReceivedDate() ) {
case MailConnectionMeta.CONDITION_DATE_EQUAL:
case MailConnectionMeta.CONDITION_DATE_GREATER:
case MailConnectionMeta.CONDITION_DATE_SMALLER:
realBeginDate = environmentSubstitute( meta.getReceivedDate1() );
if ( Utils.isEmpty( realBeginDate ) ) {
throw new KettleException( BaseMessages.getString(
PKG, "MailInput.Error.ReceivedDateSearchTermEmpty" ) );
}
beginDate = df.parse( realBeginDate );
break;
case MailConnectionMeta.CONDITION_DATE_BETWEEN:
realBeginDate = environmentSubstitute( meta.getReceivedDate1() );
if ( Utils.isEmpty( realBeginDate ) ) {
throw new KettleException( BaseMessages.getString(
PKG, "MailInput.Error.ReceivedDatesSearchTermEmpty" ) );
}
beginDate = df.parse( realBeginDate );
String realEndDate = environmentSubstitute( meta.getReceivedDate2() );
if ( Utils.isEmpty( realEndDate ) ) {
throw new KettleException( BaseMessages.getString(
PKG, "MailInput.Error.ReceivedDatesSearchTermEmpty" ) );
}
endDate = df.parse( realEndDate );
break;
default:
break;
}
} catch ( Exception e ) {
logError( BaseMessages.getString( PKG, "MailInput.Error.SettingSearchTerms", e.getMessage() ) );
setErrors( 1 );
stopAll();
}View on GitHub (pinned to f3058517a1)