SonarSource/sonarqube · error · IllegalArgumentException

Process [ ] does not exist

Error message

Process [%s] does not exist

What it means

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.

Solutions

  1. Check the exact key passed to fromKey against ProcessId values' getKey() output; fix typos and casing.
  2. Iterate ProcessId.values() or use ProcessId.getProcessIds() to list valid keys before parsing.
  3. If the key comes from persisted config, validate it after upgrading SonarQube and update the stored value.

Example fix

// before
ProcessId id = ProcessId.fromKey(props.value("sonar.process"));
// after
String key = props.value("sonar.process");
ProcessId id = Stream.of(ProcessId.values()).map(ProcessId::getKey).anyMatch(key::equals)
  ? ProcessId.fromKey(key)
  : ProcessId.APP; // or fail fast with a clear message
Defensive patterns

Strategy: validation

Validate before calling

boolean isValidProcessKey(String key) {
  return Arrays.stream(ProcessId.values()).anyMatch(p -> p.getKey().equals(key));
}

Try / catch

try {
  ProcessId id = ProcessId.fromKey(key);
} catch (IllegalArgumentException e) {
  logger.warn("Unknown process key: {}", key);
  // fall back to default or abort
}

Prevention

When it happens

Trigger: Calling ProcessId.fromKey() with a key string that does not match any ProcessId.getKey() value, e.g. fromKey("APP") (wrong case) or fromKey("sonarapp").

Common situations: 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.

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 SonarSource/sonarqube@184c821202 (2026-09-09). Data as JSON: /api/errors/d75076da927507a9. Report an issue: GitHub.

Appendix: source

Thrown at server/sonar-process/src/main/java/org/sonar/process/ProcessId.java:71

  /**
   * Prefix of log file, for example "web" for file "web.log"
   */
  public String getLogFilenamePrefix() {
    return logFilenamePrefix;
  }

  public String getHumanReadableName() {
    return humanReadableName;
  }

  public static ProcessId fromKey(String key) {
    for (ProcessId processId : values()) {
      if (processId.getKey().equals(key)) {
        return processId;
      }
    }
    throw new IllegalArgumentException(format("Process [%s] does not exist", key));
  }

}

View on GitHub (pinned to 184c821202)