{"record":{"id":"431bb37710f486ef","repo":"pentaho/pentaho-kettle","slug":"jobentrysyslog-unknownfacility","errorCode":null,"errorMessage":"JobEntrySyslog.UnknownFacility","messagePattern":"JobEntrySyslog\\.UnknownFacility","errorType":"exception","errorClass":"SyslogException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/syslog/SyslogDefs.java","lineNumber":102,"sourceCode":"  public static int computeCode( int facility, int priority ) {\n    return ( ( facility << 3 ) | priority );\n  }\n\n  public static int getPriority( String priority ) throws SyslogException {\n    Integer result = SyslogDefs.priHash.get( priority );\n\n    if ( result == null ) {\n      throw new SyslogException( BaseMessages.getString( PKG, \"JobEntrySyslog.UnknownPriotity\", priority ) );\n    }\n\n    return result.intValue();\n  }\n\n  public static int getFacility( String facility ) throws SyslogException {\n    Integer result = SyslogDefs.facHash.get( facility );\n\n    if ( result == null ) {\n      throw new SyslogException( BaseMessages.getString( PKG, \"JobEntrySyslog.UnknownFacility\", facility ) );\n    }\n    return result.intValue();\n  }\n\n  public static void sendMessage( SyslogIF syslog, int priority, String message, boolean addTimestamp,\n    String pattern, boolean addHostName ) {\n\n    String messageString = message;\n\n    // Do we need to add hostname?\n    if ( addHostName ) {\n      messageString = Const.getHostname() + \" \" + messageString;\n    }\n\n    // Do we need to add timestamp\n    if ( addTimestamp ) {\n      SimpleDateFormat dateFormat = new SimpleDateFormat( pattern );\n      dateFormat.setTimeZone( TimeZone.getDefault() );","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/syslog/SyslogDefs.java#L84-L120","documentation":"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.","triggerScenarios":"JobEntrySyslog.execute calls SyslogDefs.getFacility(facility) with a string absent from facHash — misspelled facility, wrong case, or a variable resolving to an invalid value.","commonSituations":"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.","solutions":["Use an exact lowercase facility key from SyslogDefs.facHash: kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, local0-local7","If the facility is supplied by a variable, confirm it resolves to one of those exact names","Trim/lowercase the input before setting it on the job entry","Check the entry's XML/job file for a corrupted or translated facility value"],"exampleFix":"// before: throws SyslogException\njobEntry.setFacility(\"Local7\");\n// after\njobEntry.setFacility(\"local7\");","handlingStrategy":"validation","validationCode":"// Java: whitelist-check facility against SyslogDefs keys before execute\njava.util.Set<String> valid = new java.util.HashSet<>(java.util.Arrays.asList(\n  \"kern\",\"user\",\"mail\",\"daemon\",\"auth\",\"syslog\",\"lpr\",\"news\",\"uucp\",\"cron\",\n  \"local0\",\"local1\",\"local2\",\"local3\",\"local4\",\"local5\",\"local6\",\"local7\"));\nString f = jobEntry.environmentSubstitute(jobEntry.getFacility());\nif (f == null || !valid.contains(f.trim().toLowerCase())) {\n  throw new IllegalArgumentException(\"Unknown syslog facility: \" + f);\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.execute(result, executionOffset);\n} catch (SyslogException e) {\n  if (e.getMessage().contains(\"UnknownFacility\")) {\n    logError(\"Fix facility to a valid lowercase SyslogDefs key (kern..local7)\");\n  }\n}","preventionTips":["Use exact lowercase facility names (kern, user, ..., local7)","Normalize case on any variable-supplied facility","Never store numeric facility codes where a symbolic name is expected","Validate entry XML after copy/paste between jobs"],"tags":["pentaho-kettle","syslog","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}