SonarSource/sonarqube · error · IllegalArgumentException
Unsupported issue producer value
Error message
Unsupported issue producer value: %d
What it means
IssueProducer.fromDbConstant maps a database integer constant to an IssueProducer enum value; if no enum constant matches, it throws IllegalArgumentException. This protects against unknown DB values appearing after upgrades.
Solutions
- Verify the producer column value against valid IssueProducer dbConstants
- Correct the bad row value in the database
- Upgrade/downgrade so the DB schema matches the running version
Example fix
// before
IssueProducer p = IssueProducer.fromDbConstant(rs.getInt("issue_producer"));
// after
int raw = rs.getInt("issue_producer");
IssueProducer p = Arrays.stream(IssueProducer.values())
.filter(v -> v.getDbConstant() == raw).findFirst()
.orElse(IssueProducer.API_ISSUE); // or log and skip Defensive patterns
Strategy: validation
Validate before calling
boolean known = Arrays.stream(IssueProducer.values())
.anyMatch(v -> v.getDbConstant() == dbConstant);
if (!known) { LOG.warn("Unknown issue producer value: {}", dbConstant); } Try / catch
try {
producer = IssueProducer.fromDbConstant(dbConstant);
} catch (IllegalArgumentException e) {
LOG.warn("Unknown producer {}", dbConstant);
producer = null; // handle/skip row
} Prevention
- Keep DB schema and application versions in sync
- Wrap fromDbConstant with a lenient mapper that logs unknown values
- Add migration checks for enum-typed DB columns
When it happens
Trigger: Reading an ISSUES row (or similar) whose producer column holds an integer with no matching IssueProducer dbConstant.
Common situations: Manually edited or migrated database rows; DB values written by a newer/older SonarQube version; data corruption.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Invalid type:
- Invalid type
- a JVM option can't be empty and must start with '-'. The…
- Address contains invalid character: 0x%02x
- allowAllGroups can only be enabled when Auto-provisioning…
AI-assisted analysis of SonarSource/sonarqube@184c821202 (2026-09-09).
Data as JSON: /api/errors/6265f39594d07bcd.
Report an issue: GitHub.
Appendix: source
Thrown at sonar-core/src/main/java/org/sonar/core/issue/IssueProducer.java:48
IssueProducer(int dbConstant) {
this.dbConstant = dbConstant;
}
public int getDbConstant() {
return dbConstant;
}
public static IssueProducer fromDbConstant(@Nullable Integer dbConstant) {
if (dbConstant == null) {
return SCANNER;
}
for (IssueProducer producer : values()) {
if (producer.getDbConstant() == dbConstant) {
return producer;
}
}
throw new IllegalArgumentException(format("Unsupported issue producer value: %d", dbConstant));
}
}
View on GitHub (pinned to 184c821202)