{"record":{"id":"4b2a8bba5b6660dd","repo":"pentaho/pentaho-kettle","slug":"jobentrysyslog-unknownpriotity","errorCode":null,"errorMessage":"JobEntrySyslog.UnknownPriotity","messagePattern":"JobEntrySyslog\\.UnknownPriotity","errorType":"exception","errorClass":"SyslogException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/syslog/SyslogDefs.java","lineNumber":92,"sourceCode":"    priHash.put( \"EMERGENCY\", SyslogConstants.LEVEL_EMERGENCY );\n    priHash.put( \"ALERT\", SyslogConstants.LEVEL_ALERT );\n    priHash.put( \"CRITICAL\", SyslogConstants.LEVEL_CRITICAL );\n    priHash.put( \"ERROR\", SyslogConstants.LEVEL_ERROR );\n    priHash.put( \"WARNING\", SyslogConstants.LEVEL_WARN );\n    priHash.put( \"NOTICE\", SyslogConstants.LEVEL_NOTICE );\n    priHash.put( \"INFO\", SyslogConstants.LEVEL_INFO );\n    priHash.put( \"DEBUG\", SyslogConstants.LEVEL_DEBUG );\n  }\n\n  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;","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/syslog/SyslogDefs.java#L74-L110","documentation":"SyslogDefs.getPriority looks up the priority string in the static priHash map of valid syslog priorities (e.g. emerg, alert, crit, err, warning, notice, info, debug). An unknown key yields null and a SyslogException with the localized 'JobEntrySyslog.UnknownPriotity' message including the offending value.","triggerScenarios":"JobEntrySyslog.execute calls SyslogDefs.getPriority(priority) with a priority string that is not a key of priHash — typically a misspelled priority or one set via a variable that resolved to garbage.","commonSituations":"Typo like 'Warnings' or 'critical' (case differs: map keys are lowercase); variable ${PRIORITY} unresolved or set to a numeric severity (0-7) instead of the symbolic name; locale-translated label pasted from a non-English UI.","solutions":["Use an exact key from SyslogDefs.priHash: emerg, alert, crit, err, warning, notice, info, debug (lowercase)","If priority comes from a variable, verify it resolves to one of those exact lowercase names","Log/print environmentSubstitute(getPriority()) before execution to see the actual value","Normalize input: value = value.toLowerCase().trim() before passing to the entry"],"exampleFix":"// before: throws SyslogException\njobEntry.setPriority(\"Critical\");\n// after\njobEntry.setPriority(\"crit\"); // exact lowercase key from SyslogDefs.priHash","handlingStrategy":"validation","validationCode":"// Java: whitelist-check priority against SyslogDefs keys before execute\njava.util.Set<String> valid = new java.util.HashSet<>(java.util.Arrays.asList(\n  \"emerg\",\"alert\",\"crit\",\"err\",\"warning\",\"notice\",\"info\",\"debug\"));\nString p = jobEntry.environmentSubstitute(jobEntry.getPriority());\nif (p == null || !valid.contains(p.trim().toLowerCase())) {\n  throw new IllegalArgumentException(\"Unknown syslog priority: \" + p);\n}","typeGuard":null,"tryCatchPattern":"try {\n  jobEntry.execute(result, executionOffset);\n} catch (SyslogException e) {\n  if (e.getMessage().contains(\"UnknownPriotity\")) {\n    logError(\"Fix priority to one of: emerg..debug (lowercase)\");\n  }\n}","preventionTips":["Use exact lowercase priority names from SyslogDefs.priHash","Lowercase/trim variables feeding the priority field","Avoid localized UI labels in configuration files","Log the resolved variable value during job design"],"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"}