SonarSource/sonarqube · error · IllegalArgumentException
The status is missing
Error message
The status is missing
What it means
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.
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
Example fix
// before POST api/rules/update?key=java:S2076&name=NewName // after POST api/rules/update?key=java:S2076&name=NewName&status=READY
Defensive patterns
Strategy: validation
Validate before calling
const VALID = ["READY","BETA","DEPRECATED"];
if (!VALID.includes(status)) throw new Error(`Invalid status '${status}'. Use one of ${VALID.join(",")}`); Type guard
function hasStatus(p) {
return typeof p.status === 'string' && ["READY","BETA","DEPRECATED"].includes(p.status.toUpperCase());
} Try / catch
try {
await post("api/rules/update", params);
} catch (e) {
if (String(e.message).includes("The status is missing")) {
console.error("Send a valid 'status' (READY, BETA, DEPRECATED) with the rule update");
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- The description is missing
- The name is missing
- Both 'severity' and 'impacts' parameters cannot be set at…
- Impacts are is missing
- No client ID for setting with key
AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09).
Data as JSON: /api/errors/4f4e93ff1b76faae.
Report an issue: GitHub.
Appendix: source
Thrown at server/sonar-webserver-webapi/src/main/java/org/sonar/server/rule/RuleUpdater.java:191
}
RuleDescriptionSectionDto descriptionSectionDto = createDefaultRuleDescriptionSection(uuidFactory.create(), description);
rule.setDescriptionFormat(RuleDto.Format.MARKDOWN);
rule.replaceRuleDescriptionSectionDtos(List.of(descriptionSectionDto));
}
private static void updateSeverity(RuleUpdate update, RuleDto rule) {
String severity = update.getSeverity();
if (isNullOrEmpty(severity) || !Severity.ALL.contains(severity)) {
throw new IllegalArgumentException("The severity is invalid");
}
rule.setSeverity(severity);
updateImpactSeverity(rule, severity);
}
private static void updateStatus(RuleUpdate update, RuleDto rule) {
RuleStatus status = update.getStatus();
if (status == null) {
throw new IllegalArgumentException("The status is missing");
}
rule.setStatus(status);
}
private static void updateTags(RuleUpdate update, RuleDto rule) {
Set<String> tags = update.getTags();
if (tags == null || tags.isEmpty()) {
rule.setTags(Collections.emptySet());
} else {
RuleTagHelper.applyTags(rule, tags);
}
}
private static void updateDebtRemediationFunction(RuleUpdate update, RuleDto rule) {
DebtRemediationFunction function = update.getDebtRemediationFunction();
if (function == null) {
rule.setRemediationFunction(null);
rule.setRemediationGapMultiplier(null);View on GitHub (pinned to 184c821202)