SonarSource/sonarqube · error · IllegalArgumentException

No plugin with key ' ' or plugin ' ' is already in latest…

Error message

No plugin with key '%s' or plugin '%s' is already in latest compatible version

What it means

UpdateAction implements api/plugins/update. It resolves the requested key among the update center's plugin updates; if no compatible update exists — the key is unknown, the plugin has no newer compatible version, or the update center is unavailable — it throws IllegalArgumentException saying the plugin is absent or already in its latest compatible version.

Solutions

  1. Verify with GET api/plugins/updates that the key has a pending update; skip the update call when none exists.
  2. Make the script idempotent: only call api/plugins/update when api/plugins/updates lists that key.
  3. Confirm the update center is reachable (sonar.updatecenter.url, proxy settings) and that your SonarQube version has compatible plugin releases; then retry.

Example fix

// before
await api.plugins.update({ key: 'sonar-java' }); // fails when already latest
// after
const updates = await api.plugins.updates();
if (updates.plugins.some(p => p.key === 'sonar-java')) {
  await api.plugins.update({ key: 'sonar-java' });
}
Defensive patterns

Strategy: validation

Validate before calling

const updates = (await api.plugins.updates()).plugins;
const pending = updates.find(p => p.key === key);
if (!pending) throw new Error(`no compatible update for '${key}'; already latest or unknown key`);

Type guard

function hasPendingUpdate(updates, key) {
  return Array.isArray(updates) && updates.some(p => p && p.key === key);
}

Try / catch

try {
  await api.plugins.update({ key });
} catch (e) {
  if (String(e.message).startsWith('No plugin with key')) {
    log(`no update to apply for '${key}'`);
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: POST api/plugins/update?key=<key> where no update-center entry matches the key with a newer compatible release: plugin already up to date, wrong/renamed key, or update center fetch failed so findPluginUpdates is empty.

Common situations: Idempotent upgrade scripts re-running against an already-patched server; SonarQube version too new/old for the plugin's compatible releases so no compatible update appears; firewalled servers that cannot reach the update center.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at server/sonar-webserver-webapi/src/main/java/org/sonar/server/plugins/ws/UpdateAction.java:92

    String key = request.mandatoryParam(PARAM_KEY);
    PluginUpdate pluginUpdate = findPluginUpdateByKey(key);
    pluginDownloader.download(key, pluginUpdate.getRelease().getVersion());
    response.noContent();
  }

  @Nonnull
  private PluginUpdate findPluginUpdateByKey(String key) {
    Optional<UpdateCenter> updateCenter = updateCenterFactory.getUpdateCenter(false);
    PluginUpdate pluginUpdate = MISSING_PLUGIN;

    if (updateCenter.isPresent()) {
      pluginUpdate = updateCenter.get().findPluginUpdates().stream()
        .filter(update -> update != null && key.equals(update.getPlugin().getKey()))
        .findFirst().orElse(MISSING_PLUGIN);
    }

    if (pluginUpdate == MISSING_PLUGIN) {
      throw new IllegalArgumentException(
        format("No plugin with key '%s' or plugin '%s' is already in latest compatible version", key, key));
    }
    return pluginUpdate;
  }
}

View on GitHub (pinned to 184c821202)