{"record":{"id":"6265f39594d07bcd","repo":"SonarSource/sonarqube","slug":"unsupported-issue-producer-value-d","errorCode":null,"errorMessage":"Unsupported issue producer value: %d","messagePattern":"Unsupported issue producer value: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sonar-core/src/main/java/org/sonar/core/issue/IssueProducer.java","lineNumber":48,"sourceCode":"\n  IssueProducer(int dbConstant) {\n    this.dbConstant = dbConstant;\n  }\n\n  public int getDbConstant() {\n    return dbConstant;\n  }\n\n  public static IssueProducer fromDbConstant(@Nullable Integer dbConstant) {\n    if (dbConstant == null) {\n      return SCANNER;\n    }\n    for (IssueProducer producer : values()) {\n      if (producer.getDbConstant() == dbConstant) {\n        return producer;\n      }\n    }\n    throw new IllegalArgumentException(format(\"Unsupported issue producer value: %d\", dbConstant));\n  }\n}\n","sourceCodeStart":30,"sourceCodeEnd":51,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/sonar-core/src/main/java/org/sonar/core/issue/IssueProducer.java#L30-L51","documentation":"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.","triggerScenarios":"Reading an ISSUES row (or similar) whose producer column holds an integer with no matching IssueProducer dbConstant.","commonSituations":"Manually edited or migrated database rows; DB values written by a newer/older SonarQube version; data corruption.","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"],"exampleFix":"// before\nIssueProducer p = IssueProducer.fromDbConstant(rs.getInt(\"issue_producer\"));\n// after\nint raw = rs.getInt(\"issue_producer\");\nIssueProducer p = Arrays.stream(IssueProducer.values())\n  .filter(v -> v.getDbConstant() == raw).findFirst()\n  .orElse(IssueProducer.API_ISSUE); // or log and skip","handlingStrategy":"validation","validationCode":"boolean known = Arrays.stream(IssueProducer.values())\n  .anyMatch(v -> v.getDbConstant() == dbConstant);\nif (!known) { LOG.warn(\"Unknown issue producer value: {}\", dbConstant); }","typeGuard":null,"tryCatchPattern":"try {\n  producer = IssueProducer.fromDbConstant(dbConstant);\n} catch (IllegalArgumentException e) {\n  LOG.warn(\"Unknown producer {}\", dbConstant);\n  producer = null; // handle/skip row\n}","preventionTips":["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"],"tags":["database","enum","validation"],"backgroundTag":"invalid-enum-value","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"}