SonarSource/sonarqube · critical

Fail to launch monitor of process [%s]

Error message

Fail to launch monitor of process [%s]

What it means

ProcessLauncherImpl.launch starts a monitoring thread for a managed child process (ES, web, CE). If any exception occurs while setting up or launching that monitor, it forcibly destroys the spawned process and wraps the cause in this IllegalStateException, using the process's human-readable name for diagnosis.

Source

Thrown at server/sonar-main/src/main/java/org/sonar/application/ProcessLauncherImpl.java:118

    ProcessId processId = command.getProcessId();
    try {
      if (processId == ProcessId.ELASTICSEARCH) {
        checkArgument(esInstallation != null, "Incorrect configuration EsInstallation is null");
        EsConnectorImpl esConnector = new EsConnectorImpl(singleton(HostAndPort.fromParts(esInstallation.getHost(),
          esInstallation.getHttpPort())), esInstallation.getBootstrapPassword(), esInstallation.getHttpKeyStoreLocation(),
          esInstallation.getHttpKeyStorePassword().orElse(null));
        return new EsManagedProcess(process, processId, esConnector);
      } else {
        ProcessCommands commands = allProcessesCommands.createAfterClean(processId.getIpcIndex());
        return new ProcessCommandsManagedProcess(process, processId, commands);
      }
    } catch (Exception e) {
      // just in case
      if (process != null) {
        process.destroyForcibly();
      }
      throw new IllegalStateException(format("Fail to launch monitor of process [%s]", processId.getHumanReadableName()), e);
    }
  }

  private static void cleanupOutdatedEsData(EsInstallation esInstallation) {
    esInstallation.getOutdatedSearchDirectories()
      .forEach(outdatedDir -> {
        if (outdatedDir.exists()) {
          LOG.info("Deleting outdated search index data directory {}", outdatedDir.getAbsolutePath());
          try {
            FileUtils2.deleteDirectory(outdatedDir);

            if (outdatedDir.exists()) {
              LOG.info("Failed to delete outdated search index data directory {}", outdatedDir);
            }
          } catch (IOException e) {
            LOG.info("Failed to delete outdated search index data directory {}", outdatedDir.getAbsolutePath(), e);
          }
        }

View on GitHub (pinned to 184c821202)

Solutions

  1. Read the 'Caused by' exception in the log for the underlying cause and fix it (permissions, paths, ports).
  2. Verify the bundled elasticsearch directory under the installation is intact and not partially deleted.
  3. Check disk space and permissions on sonar.path.data/sonar.path.temp directories.
  4. Ensure the sonarqube process user can execute the bundled ES binary (no noexec mounts).

Example fix

// diagnose
$ tail -100 logs/sonar.log   // inspect 'Caused by' under 'Fail to launch monitor of process [elasticsearch]'
$ chown -R sonarqube:sonarqube /opt/sonarqube/data /opt/sonarqube/temp
Defensive patterns

Strategy: try-catch

Validate before calling

ProcessHandle.of(pid).ifPresent(h -> log.info("child process alive after monitor start"));
// pre-check: bundled ES dir executable
File es = new File("elasticsearch/bin/elasticsearch");
if (!es.canExecute()) throw new IllegalStateException("ES binary not executable: " + es);

Try / catch

try { launcher.launch(command, false); } catch (IllegalStateException e) { log.severe("Monitor launch failed: " + e.getMessage() + ", cause=" + e.getCause()); }

Prevention

When it happens

Trigger: Any Exception thrown inside launch() while starting the monitor of a process such as Elasticsearch — e.g. failures preparing ES data/conf directories, security setup, or the underlying launchJava call — during SonarQube startup.

Common situations: Broken Elasticsearch installation directory, unreadable data path, port or filesystem errors during bootstrap, corrupted bundled ES, or JVM/OS-level failures starting the child process on a fresh install.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09). Data as JSON: /api/errors/6d15e0e95eedc7fd. Report an issue: GitHub.