pentaho/pentaho-kettle · error · SyslogException

JobEntrySyslog.UnknownFacility

Error message

JobEntrySyslog.UnknownFacility

What it means

SyslogDefs.getFacility looks up the facility string in the static facHash map of valid syslog facilities (kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, local0..local7). An unknown key yields null and a SyslogException with the localized 'JobEntrySyslog.UnknownFacility' message naming the bad value.

Solutions

  1. Use an exact lowercase facility key from SyslogDefs.facHash: kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, local0-local7
  2. If the facility is supplied by a variable, confirm it resolves to one of those exact names
  3. Trim/lowercase the input before setting it on the job entry
  4. Check the entry's XML/job file for a corrupted or translated facility value

Example fix

// before: throws SyslogException
jobEntry.setFacility("Local7");
// after
jobEntry.setFacility("local7");
Defensive patterns

Strategy: validation

Validate before calling

// Java: whitelist-check facility against SyslogDefs keys before execute
java.util.Set<String> valid = new java.util.HashSet<>(java.util.Arrays.asList(
  "kern","user","mail","daemon","auth","syslog","lpr","news","uucp","cron",
  "local0","local1","local2","local3","local4","local5","local6","local7"));
String f = jobEntry.environmentSubstitute(jobEntry.getFacility());
if (f == null || !valid.contains(f.trim().toLowerCase())) {
  throw new IllegalArgumentException("Unknown syslog facility: " + f);
}

Try / catch

try {
  jobEntry.execute(result, executionOffset);
} catch (SyslogException e) {
  if (e.getMessage().contains("UnknownFacility")) {
    logError("Fix facility to a valid lowercase SyslogDefs key (kern..local7)");
  }
}

Prevention

When it happens

Trigger: JobEntrySyslog.execute calls SyslogDefs.getFacility(facility) with a string absent from facHash — misspelled facility, wrong case, or a variable resolving to an invalid value.

Common situations: Typo like 'Local7' vs 'local7' or 'security' on newer platforms; variable ${FACILITY} unset/empty at runtime; user entered a numeric facility code instead of the symbolic name.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/syslog/SyslogDefs.java:102

  public static int computeCode( int facility, int priority ) {
    return ( ( facility << 3 ) | priority );
  }

  public static int getPriority( String priority ) throws SyslogException {
    Integer result = SyslogDefs.priHash.get( priority );

    if ( result == null ) {
      throw new SyslogException( BaseMessages.getString( PKG, "JobEntrySyslog.UnknownPriotity", priority ) );
    }

    return result.intValue();
  }

  public static int getFacility( String facility ) throws SyslogException {
    Integer result = SyslogDefs.facHash.get( facility );

    if ( result == null ) {
      throw new SyslogException( BaseMessages.getString( PKG, "JobEntrySyslog.UnknownFacility", facility ) );
    }
    return result.intValue();
  }

  public static void sendMessage( SyslogIF syslog, int priority, String message, boolean addTimestamp,
    String pattern, boolean addHostName ) {

    String messageString = message;

    // Do we need to add hostname?
    if ( addHostName ) {
      messageString = Const.getHostname() + " " + messageString;
    }

    // Do we need to add timestamp
    if ( addTimestamp ) {
      SimpleDateFormat dateFormat = new SimpleDateFormat( pattern );
      dateFormat.setTimeZone( TimeZone.getDefault() );

View on GitHub (pinned to f3058517a1)