{"record":{"id":"6d15e0e95eedc7fd","repo":"SonarSource/sonarqube","slug":"fail-to-launch-monitor-of-process-s","errorCode":null,"errorMessage":"Fail to launch monitor of process [%s]","messagePattern":"Fail to launch monitor of process \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"server/sonar-main/src/main/java/org/sonar/application/ProcessLauncherImpl.java","lineNumber":118,"sourceCode":"\n    ProcessId processId = command.getProcessId();\n    try {\n      if (processId == ProcessId.ELASTICSEARCH) {\n        checkArgument(esInstallation != null, \"Incorrect configuration EsInstallation is null\");\n        EsConnectorImpl esConnector = new EsConnectorImpl(singleton(HostAndPort.fromParts(esInstallation.getHost(),\n          esInstallation.getHttpPort())), esInstallation.getBootstrapPassword(), esInstallation.getHttpKeyStoreLocation(),\n          esInstallation.getHttpKeyStorePassword().orElse(null));\n        return new EsManagedProcess(process, processId, esConnector);\n      } else {\n        ProcessCommands commands = allProcessesCommands.createAfterClean(processId.getIpcIndex());\n        return new ProcessCommandsManagedProcess(process, processId, commands);\n      }\n    } catch (Exception e) {\n      // just in case\n      if (process != null) {\n        process.destroyForcibly();\n      }\n      throw new IllegalStateException(format(\"Fail to launch monitor of process [%s]\", processId.getHumanReadableName()), e);\n    }\n  }\n\n  private static void cleanupOutdatedEsData(EsInstallation esInstallation) {\n    esInstallation.getOutdatedSearchDirectories()\n      .forEach(outdatedDir -> {\n        if (outdatedDir.exists()) {\n          LOG.info(\"Deleting outdated search index data directory {}\", outdatedDir.getAbsolutePath());\n          try {\n            FileUtils2.deleteDirectory(outdatedDir);\n\n            if (outdatedDir.exists()) {\n              LOG.info(\"Failed to delete outdated search index data directory {}\", outdatedDir);\n            }\n          } catch (IOException e) {\n            LOG.info(\"Failed to delete outdated search index data directory {}\", outdatedDir.getAbsolutePath(), e);\n          }\n        }","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-main/src/main/java/org/sonar/application/ProcessLauncherImpl.java#L100-L136","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the 'Caused by' exception in the log for the underlying cause and fix it (permissions, paths, ports).","Verify the bundled elasticsearch directory under the installation is intact and not partially deleted.","Check disk space and permissions on sonar.path.data/sonar.path.temp directories.","Ensure the sonarqube process user can execute the bundled ES binary (no noexec mounts)."],"exampleFix":"// diagnose\n$ tail -100 logs/sonar.log   // inspect 'Caused by' under 'Fail to launch monitor of process [elasticsearch]'\n$ chown -R sonarqube:sonarqube /opt/sonarqube/data /opt/sonarqube/temp","handlingStrategy":"try-catch","validationCode":"ProcessHandle.of(pid).ifPresent(h -> log.info(\"child process alive after monitor start\"));\n// pre-check: bundled ES dir executable\nFile es = new File(\"elasticsearch/bin/elasticsearch\");\nif (!es.canExecute()) throw new IllegalStateException(\"ES binary not executable: \" + es);","typeGuard":null,"tryCatchPattern":"try { launcher.launch(command, false); } catch (IllegalStateException e) { log.severe(\"Monitor launch failed: \" + e.getMessage() + \", cause=\" + e.getCause()); }","preventionTips":["Keep the bundled Elasticsearch directory intact and executable.","Ensure disk space and correct ownership of data/temp directories before startup.","Avoid noexec mounts on the SonarQube installation volume."],"tags":["process-launch","elasticsearch","startup"],"backgroundTag":"http-request-failed","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}