{"record":{"id":"f06f6cb641a1f28b","repo":"SonarSource/sonarqube","slug":"plugin-s-is-not-installed","errorCode":null,"errorMessage":"Plugin [%s] is not installed","messagePattern":"Plugin \\[(.+?)\\] is not installed","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/PluginUninstaller.java","lineNumber":71,"sourceCode":"  public void start() {\n    try {\n      forceMkdir(fs.getUninstalledPluginsDir());\n    } catch (IOException e) {\n      throw new IllegalStateException(\"Fail to create the directory: \" + fs.getUninstalledPluginsDir(), e);\n    }\n  }\n\n  @Override\n  public void stop() {\n    // Nothing to do\n  }\n\n  /**\n   * Uninstall a plugin and its dependents\n   */\n  public void uninstall(String pluginKey) {\n    if (!pluginRepository.hasPlugin(pluginKey) || pluginRepository.getPlugin(pluginKey).getType() != EXTERNAL) {\n      throw new IllegalArgumentException(format(\"Plugin [%s] is not installed\", pluginKey));\n    }\n\n    Set<String> uninstallKeys = new HashSet<>();\n    uninstallKeys.add(pluginKey);\n    appendDependentPluginKeys(pluginKey, uninstallKeys);\n\n    for (String uninstallKey : uninstallKeys) {\n      PluginInfo info = pluginRepository.getPluginInfo(uninstallKey);\n      // we don't check type because the dependent of an external plugin should never be a bundled plugin!\n      uninstall(info.getKey(), info.getName(), info.getNonNullJarFile().getName());\n    }\n  }\n\n  public void cancelUninstalls() {\n    for (File file : listJarFiles(fs.getUninstalledPluginsDir())) {\n      try {\n        moveFileToDirectory(file, fs.getInstalledExternalPluginsDir(), false);\n      } catch (IOException e) {","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/PluginUninstaller.java#L53-L89","documentation":"PluginUninstaller.uninstall only allows uninstalling plugins present in the PluginRepository AND of type EXTERNAL. If the plugin key is unknown or the plugin is a BUNDLE/CORE plugin, it throws IllegalArgumentException \"Plugin [%s] is not installed\".","triggerScenarios":"Calling uninstall (Marketplace UI or api/plugins/uninstall) with a plugin key that doesn't exist, is misspelled, or refers to a bundled plugin that cannot be removed.","commonSituations":"Uninstalling a bundled plugin (e.g. 'core' or language bundles); wrong plugin key casing; plugin already removed; invoking uninstall on a key taken from a different SonarQube instance.","solutions":["Verify the exact plugin key via api/plugins/installed or the Marketplace UI before uninstalling.","Bundled plugins cannot be uninstalled — remove/ignore them differently (they ship with SonarQube).","If the plugin is already gone, refresh the plugin list; the state may be stale.","For custom plugins, confirm they were installed as EXTERNAL (from Marketplace or extensions/plugins directory)."],"exampleFix":"// before\npluginUninstaller.uninstall(\"sonar-java\"); // bundled plugin\n// after (only EXTERNAL plugins)\npluginUninstaller.uninstall(\"mycompany-custom-rules\");","handlingStrategy":"validation","validationCode":"boolean isUninstallable(PluginRepository repo, String key) {\n  return repo.hasPlugin(key) && repo.getPlugin(key).getType() == org.sonar.core.platform.PluginInfo.Type.EXTERNAL;\n}","typeGuard":null,"tryCatchPattern":"try { pluginUninstaller.uninstall(key); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Plugin [\") ) { log.warn(\"Cannot uninstall {}: not installed or not external\", key); return; } throw e; }","preventionTips":["Look up exact plugin keys via api/plugins/installed","Never attempt to uninstall bundled/core plugins","Refresh plugin state before uninstall operations"],"tags":["plugins","marketplace","validation"],"backgroundTag":"resource-not-found","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"}