{"record":{"id":"12a272d1d0574dba","repo":"SonarSource/sonarqube","slug":"impacts-are-is-missing","errorCode":null,"errorMessage":"Impacts are is missing","messagePattern":"Impacts are is missing","errorType":"http","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdater.java","lineNumber":147,"sourceCode":"    }\n    // order is important -> sub-characteristic must be set\n    if (update.isChangeDebtRemediationFunction()) {\n      updateDebtRemediationFunction(update, rule);\n    }\n  }\n\n  private static void updateImpactSeverity(RuleDto rule, String severity) {\n    rule.getDefaultImpacts()\n      .stream()\n      .filter(i -> i.getSoftwareQuality() == ImpactMapper.convertToSoftwareQuality(RuleTypeMapper.toApiRuleType(rule.getEnumType())))\n      .findFirst()\n      .ifPresent(i -> i.setSeverity(mapImpactSeverity(severity)));\n  }\n\n  private static void updateImpactSeverityAndStandardSeverityIfTypeMatch(RuleUpdate update, RuleDto rule) {\n    Map<SoftwareQuality, org.sonar.api.issue.impact.Severity> impacts = update.getImpactSeverities();\n    if (impacts.isEmpty()) {\n      throw new IllegalArgumentException(\"Impacts are is missing\");\n    }\n    impacts.forEach((key, value) -> rule.getDefaultImpacts()\n      .stream()\n      .filter(i -> i.getSoftwareQuality() == key)\n      .findFirst()\n      .ifPresent(i -> {\n        i.setSeverity(value);\n        if (RuleTypeMapper.toRuleType(convertToRuleType(key)) == RuleType.fromDbConstant(rule.getType())) {\n          rule.setSeverity(convertToDeprecatedSeverity(value));\n        }\n      }));\n  }\n\n  private static void updateName(RuleUpdate update, RuleDto rule) {\n    String name = update.getName();\n    if (isNullOrEmpty(name)) {\n      throw new IllegalArgumentException(\"The name is missing\");\n    }","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdater.java#L129-L165","documentation":"RuleUpdater.updateImpactSeverityAndStandardSeverityIfTypeMatch requires the update to carry at least one impact severity; an empty impact map means the caller asked to update a rule by impacts but provided none, so an IllegalArgumentException (with a known typo, 'Impacts are is missing') is thrown.","triggerScenarios":"Calling api/rules/update with 'impacts' set but parsed to an empty map, or an internal RuleUpdate built without impact severities while the apply path still invokes the impact updater.","commonSituations":"Client sends impacts parameter as an empty string or empty list after parsing strips entries; template/custom rule update flows that pass an empty impacts map; API version mismatch where impacts parsing silently produces an empty map.","solutions":["Provide at least one valid impact, e.g. impacts=SECURITY>HIGH, when updating by impacts","If you only want to change severity, pass the 'severity' parameter instead of 'impacts'","Verify the client is not dropping impact entries before sending the request (check request payload)"],"exampleFix":"// before\nPOST api/rules/update?key=java:S2076&impacts=\n// after\nPOST api/rules/update?key=java:S2076&impacts=SECURITY>HIGH","handlingStrategy":"validation","validationCode":"if (useImpacts && (!impacts || Object.keys(impacts).length === 0)) {\n  throw new Error(\"Provide at least one impact (e.g. impacts=SECURITY>HIGH) or use 'severity' instead\");\n}","typeGuard":"function hasImpacts(params) {\n  return typeof params.impacts === 'string' && params.impacts.includes('>');\n}","tryCatchPattern":"try {\n  await post(\"api/rules/update\", params);\n} catch (e) {\n  if (String(e.message).includes(\"Impacts are is missing\")) {\n    params.impacts = \"SECURITY>HIGH\"; // or switch to severity param\n    await post(\"api/rules/update\", params);\n  }\n}","preventionTips":["Never send an empty impacts parameter; omit it or supply quality>severity pairs","Pick one update model per call: either severity or impacts","Inspect the outgoing request body in CI logs to confirm impacts entries are present"],"tags":["sonarqube","rules","impacts","empty-input"],"backgroundTag":"empty-required-field","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"}