{"record":{"id":"9e3dba2c856de0ba","repo":"SonarSource/sonarqube","slug":"unsupported-dialect-id-9e3dba","errorCode":null,"errorMessage":"Unsupported dialect id ","messagePattern":"Unsupported dialect id ","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v202605/CreateIndexOnIssuesDeferralDate.java","lineNumber":66,"sourceCode":"    }\n  }\n\n  private void createIndex(Context context, Connection connection) {\n    if (DatabaseUtils.indexExistsIgnoreCase(TABLE_NAME, INDEX_NAME, connection)) {\n      return;\n    }\n    switch (getDialect().getId()) {\n      // Partial index: only rows with a pending deferral are stored, so INCLUDE columns stay cheap.\n      case PostgreSql.ID, MsSql.ID -> context.execute(\n        format(\"CREATE INDEX %s ON %s (%s) INCLUDE (%s) WHERE %s IS NOT NULL\",\n          INDEX_NAME, TABLE_NAME, COLUMN_NAME, INCLUDE_COLUMNS, COLUMN_NAME));\n      // Oracle B-tree omits rows where all indexed columns are NULL, so a plain single-column\n      // index is already partial there. Do not add status/project_uuid as key columns - that would\n      // make every row non-NULL again and defeat it. H2 does index NULL keys, so the index is not\n      // partial there; H2 is only used for tests and the schema dump, so that is acceptable.\n      case Oracle.ID, H2.ID -> context.execute(\n        format(\"CREATE INDEX %s ON %s (%s)\", INDEX_NAME, TABLE_NAME, COLUMN_NAME));\n      default -> throw new IllegalArgumentException(\"Unsupported dialect id \" + getDialect().getId());\n    }\n  }\n}\n","sourceCodeStart":48,"sourceCodeEnd":70,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v202605/CreateIndexOnIssuesDeferralDate.java#L48-L70","documentation":"During the 202605.00 migration, CreateIndexOnIssuesDeferralDate creates an index on ISSUES.DEFERAL_DATE. Oracle (and H2) get a plain single-column index, while PostgreSQL/MySQL/MSSQL get a partial index that also filters on status and project_uuid. If the current dialect matches none of the handled cases, createIndex throws this IllegalArgumentException to abort the migration rather than create a subtly wrong index.","triggerScenarios":"Running a SonarQube server startup DB migration against a JDBC dialect whose id is not Oracle, H2, PostgreSQL, MySQL, or MSSQL — i.e. getDialect().getId() returns an unknown value when execute() invokes createIndex().","commonSituations":"Pointing sonar.jdbc.url at an unsupported or custom JDBC driver/dialect (e.g. an experimental fork, a mistyped URL string that maps to no known dialect), or running a bleeding-edge server build on a newly added dialect whose migration code has not been updated yet.","solutions":["Check sonar.jdbc.url and switch to a supported database (PostgreSQL, MySQL, MSSQL, Oracle).","Verify the JDBC driver jar matches the declared URL scheme so the correct dialect is detected.","If on a custom/newer dialect, update the migration's switch to handle its Dialect.ID with an appropriate partial/plain index.","Report the issue to SonarSource if a supported database is correctly configured and still hits this path."],"exampleFix":"// before\ndefault -> throw new IllegalArgumentException(\"Unsupported dialect id \" + getDialect().getId());\n// after\n// configure a supported database\nsonar.jdbc.url=jdbc:postgresql://localhost/sonar","handlingStrategy":"validation","validationCode":"String url = props.get(\"sonar.jdbc.url\");\nSet<String> supported = Set.of(\"postgresql\", \"mysql\", \"mssql\", \"oracle\", \"h2\");\nif (supported.stream().noneMatch(url.toLowerCase()::contains)) {\n    throw new IllegalArgumentException(\"Unsupported sonar.jdbc.url: \" + url);\n}","typeGuard":null,"tryCatchPattern":"try { migration.execute(context); } catch (IllegalArgumentException e) { log.severe(\"Migration aborted: \" + e.getMessage()); throw e; }","preventionTips":["Always deploy on a database officially supported by the SonarQube version.","Keep JDBC driver jars consistent with the sonar.jdbc.url scheme.","Test schema migrations on a staging database before production upgrade."],"tags":["database","migration","unsupported-dialect"],"backgroundTag":"unsupported-operation","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}