{"record":{"id":"d75076da927507a9","repo":"SonarSource/sonarqube","slug":"process-s-does-not-exist","errorCode":null,"errorMessage":"Process [%s] does not exist","messagePattern":"Process \\[(.+?)\\] does not exist","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/sonar-process/src/main/java/org/sonar/process/ProcessId.java","lineNumber":71,"sourceCode":"\n  /**\n   * Prefix of log file, for example \"web\" for file \"web.log\"\n   */\n  public String getLogFilenamePrefix() {\n    return logFilenamePrefix;\n  }\n\n  public String getHumanReadableName() {\n    return humanReadableName;\n  }\n\n  public static ProcessId fromKey(String key) {\n    for (ProcessId processId : values()) {\n      if (processId.getKey().equals(key)) {\n        return processId;\n      }\n    }\n    throw new IllegalArgumentException(format(\"Process [%s] does not exist\", key));\n  }\n\n}\n","sourceCodeStart":53,"sourceCodeEnd":75,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-process/src/main/java/org/sonar/process/ProcessId.java#L53-L75","documentation":"ProcessId.fromKey looks up a ProcessId enum constant by its string key (e.g. \"app\", \"ce\", \"web\", \"search\", \"es\"). If no constant's key equals the given string, it throws IllegalArgumentException. This guards the enum mapping from unknown or mistyped process keys.","triggerScenarios":"Calling ProcessId.fromKey() with a key string that does not match any ProcessId.getKey() value, e.g. fromKey(\"APP\") (wrong case) or fromKey(\"sonarapp\").","commonSituations":"Parsing a process key from configuration, command-line arguments, or persisted cluster state that was written by a different SonarQube version with different process names, or simple typos.","solutions":["Check the exact key passed to fromKey against ProcessId values' getKey() output; fix typos and casing.","Iterate ProcessId.values() or use ProcessId.getProcessIds() to list valid keys before parsing.","If the key comes from persisted config, validate it after upgrading SonarQube and update the stored value."],"exampleFix":"// before\nProcessId id = ProcessId.fromKey(props.value(\"sonar.process\"));\n// after\nString key = props.value(\"sonar.process\");\nProcessId id = Stream.of(ProcessId.values()).map(ProcessId::getKey).anyMatch(key::equals)\n  ? ProcessId.fromKey(key)\n  : ProcessId.APP; // or fail fast with a clear message","handlingStrategy":"validation","validationCode":"boolean isValidProcessKey(String key) {\n  return Arrays.stream(ProcessId.values()).anyMatch(p -> p.getKey().equals(key));\n}","typeGuard":null,"tryCatchPattern":"try {\n  ProcessId id = ProcessId.fromKey(key);\n} catch (IllegalArgumentException e) {\n  logger.warn(\"Unknown process key: {}\", key);\n  // fall back to default or abort\n}","preventionTips":["Always source process keys from ProcessId.getKey(), never hardcoded strings.","Validate keys parsed from config or persisted state against values() before calling fromKey.","Write a unit test covering every key your code feeds to fromKey."],"tags":["illegal-argument","enum","process"],"backgroundTag":"invalid-enum-value","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}