pentaho/pentaho-kettle · error · KettleException

JobEntrySyslog.DatePatternEmpty

JobEntrySyslog.DatePatternEmpty

Error message

JobEntrySyslog.DatePatternEmpty

What it means

During JobEntrySyslog.execute, when addTimestamp is enabled the entry builds a SimpleDateFormat from the datePattern field; if that pattern (after environment substitution) is empty, the entry logs and throws this KettleException before opening the syslog connection. The message text is the localized 'JobEntrySyslog.DatePatternEmpty' bundle string.

Solutions

  1. Set a valid date pattern (e.g. yyyy/MM/dd HH:mm:ss) in the job entry's Date pattern field
  2. If using a variable, define it in kettle.properties, the job's parameter set, or the environment
  3. Uncheck 'Add timestamp' if a timestamp is not needed — the pattern is only required when it is checked
  4. Fix the date pattern syntax with Java SimpleDateFormat letters (yyyy, MM, dd, HH, mm, ss)

Example fix

// before: addTimestamp=true, datePattern=null -> execute() throws
jobEntry.setAddTimestamp(true);
jobEntry.setDatePattern(null);
// after
jobEntry.setAddTimestamp(true);
jobEntry.setDatePattern("yyyy-MM-dd HH:mm:ss");
Defensive patterns

Strategy: validation

Validate before calling

// Java: validate pattern before execute()
String pattern = jobEntry.environmentSubstitute(jobEntry.getDatePattern());
if (jobEntry.isAddTimestamp() && (pattern == null || pattern.trim().isEmpty())) {
  throw new IllegalArgumentException("datePattern required when addTimestamp=true");
}

Try / catch

try {
  jobEntry.execute(result, executionOffset);
} catch (KettleException e) {
  if (e.getMessage().contains("DatePatternEmpty")) {
    logError("Set a valid SimpleDateFormat pattern or disable addTimestamp");
  }
}

Prevention

When it happens

Trigger: Running a Syslog job entry with 'Add timestamp' checked but the Date pattern field left blank, or set to a variable like ${DATE_PATTERN} that resolves to empty at runtime.

Common situations: Variable defined in a different environment (kettle.properties on a server lacks it); copy-pasted entry between jobs where the pattern was lost; user enabled timestamping but forgot the mandatory pattern field.

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


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/9d2c119acb40681f. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/syslog/JobEntrySyslog.java:289

    String messageString = environmentSubstitute( getMessage() );

    if ( Utils.isEmpty( messageString ) ) {
      logError( BaseMessages.getString( PKG, "JobEntrySyslog.MissingMessage" ) );
    }

    int nrPort = Const.toInt( environmentSubstitute( getPort() ), SyslogDefs.DEFAULT_PORT );

    SyslogIF syslog = null;
    try {
      String pattern = null;

      if ( isAddTimestamp() ) {
        // add timestamp to message
        pattern = environmentSubstitute( getDatePattern() );
        if ( Utils.isEmpty( pattern ) ) {
          logError( BaseMessages.getString( PKG, "JobEntrySyslog.DatePatternEmpty" ) );
          throw new KettleException( BaseMessages.getString( PKG, "JobEntrySyslog.DatePatternEmpty" ) );
        }

      }

      // Open syslog connection
      // Set a Specific Host, then Log to It
      syslog = Syslog.getInstance( "udp" );
      syslog.getConfig().setHost( servername );
      syslog.getConfig().setPort( nrPort );
      syslog.getConfig().setFacility( getFacility() );
      syslog.getConfig().setSendLocalName( false );
      syslog.getConfig().setSendLocalTimestamp( false );
      SyslogDefs.sendMessage(
        syslog, SyslogDefs.getPriority( getPriority() ), messageString, isAddTimestamp(), pattern,
        isAddHostName() );

      // message was sent
      result.setNrErrors( 0 );

View on GitHub (pinned to f3058517a1)