{"record":{"id":"4f4e93ff1b76faae","repo":"SonarSource/sonarqube","slug":"the-status-is-missing","errorCode":null,"errorMessage":"The status is missing","messagePattern":"The status 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":191,"sourceCode":"    }\n    RuleDescriptionSectionDto descriptionSectionDto = createDefaultRuleDescriptionSection(uuidFactory.create(), description);\n    rule.setDescriptionFormat(RuleDto.Format.MARKDOWN);\n    rule.replaceRuleDescriptionSectionDtos(List.of(descriptionSectionDto));\n  }\n\n  private static void updateSeverity(RuleUpdate update, RuleDto rule) {\n    String severity = update.getSeverity();\n    if (isNullOrEmpty(severity) || !Severity.ALL.contains(severity)) {\n      throw new IllegalArgumentException(\"The severity is invalid\");\n    }\n    rule.setSeverity(severity);\n    updateImpactSeverity(rule, severity);\n  }\n\n  private static void updateStatus(RuleUpdate update, RuleDto rule) {\n    RuleStatus status = update.getStatus();\n    if (status == null) {\n      throw new IllegalArgumentException(\"The status is missing\");\n    }\n    rule.setStatus(status);\n  }\n\n  private static void updateTags(RuleUpdate update, RuleDto rule) {\n    Set<String> tags = update.getTags();\n    if (tags == null || tags.isEmpty()) {\n      rule.setTags(Collections.emptySet());\n    } else {\n      RuleTagHelper.applyTags(rule, tags);\n    }\n  }\n\n  private static void updateDebtRemediationFunction(RuleUpdate update, RuleDto rule) {\n    DebtRemediationFunction function = update.getDebtRemediationFunction();\n    if (function == null) {\n      rule.setRemediationFunction(null);\n      rule.setRemediationGapMultiplier(null);","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdater.java#L173-L209","documentation":"RuleUpdater.updateStatus requires a parsed RuleStatus; when update.getStatus() is null the update is rejected with IllegalArgumentException('The status is missing'). Rule status (BETA, DEPRECATED, READY, etc.) is mandatory on updates that touch status.","triggerScenarios":"Calling api/rules/update with 'status' omitted or set to a value that failed to parse into a RuleStatus enum, resulting in a null status reaching updateStatus.","commonSituations":"Typo in the status value (e.g. 'READY ' with trailing space, 'ready' lowercase); scripts copying update templates without the status field; API clients sending deprecated status names.","solutions":["Pass an explicit valid status: READY, BETA, or DEPRECATED","Check server logs/response for a parameter-parsing issue if you did send 'status' (invalid values may yield null)","Add client-side enum validation before issuing the update call"],"exampleFix":"// before\nPOST api/rules/update?key=java:S2076&name=NewName\n// after\nPOST api/rules/update?key=java:S2076&name=NewName&status=READY","handlingStrategy":"validation","validationCode":"const VALID = [\"READY\",\"BETA\",\"DEPRECATED\"];\nif (!VALID.includes(status)) throw new Error(`Invalid status '${status}'. Use one of ${VALID.join(\",\")}`);","typeGuard":"function hasStatus(p) {\n  return typeof p.status === 'string' && [\"READY\",\"BETA\",\"DEPRECATED\"].includes(p.status.toUpperCase());\n}","tryCatchPattern":"try {\n  await post(\"api/rules/update\", params);\n} catch (e) {\n  if (String(e.message).includes(\"The status is missing\")) {\n    console.error(\"Send a valid 'status' (READY, BETA, DEPRECATED) with the rule update\");\n  }\n}","preventionTips":["Always send an explicit status in rule update scripts","Uppercase and trim the status value before sending","Watch for silent parameter parsing failures — a bad status value can arrive as null"],"tags":["sonarqube","rules","status","missing-field"],"backgroundTag":"missing-required-argument","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"}