You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a full migration against a brand-new PostgreSQL database, two separate SonarQube plugin migrations fail because they try to DROP a constraint/index that the migration assumes already exists from an earlier step, but doesn't on Postgres:
ERROR: constraint "_tool_sonarqube_file_metrics_pkey" of relation "_tool_sonarqube_file_metrics" does not exist (SQLSTATE 42704) ALTER TABLE _tool_sonarqube_file_metrics DROP CONSTRAINT _tool_sonarqube_file_metrics_pkey
ERROR: index "idx__tool_sonarqube_issue_code_blocks_component" does not exist (SQLSTATE 42704) (from DropIndexes("_tool_sonarqube_issue_code_blocks", "idx__tool_sonarqube_issue_code_blocks_component"))
Environment:
DevLake version: v1.0.3-beta15
Database: PostgreSQL 18
Deployment: official Helm chart with external DB_URL
Workaround
We excluded the plugin by mounting an empty directory where the sonarqube plugin would be installed otherwise.
This is pretty hacky and we are wondering if this could be fixed in the helm-chart. it works fine for using MySQL but we have requirements to use Postgres.
Both errors come from the DevLake backend (the SonarQube plugin's migration scripts), not from the Helm chart, so there is nothing to change in the chart itself.
Please follow apache/devlake#9242. Once it is merged and included in a release, you should be able to drop the workaround that excludes the sonarqube plugin.
Activity
chenwei791129 commentedon Oct 19, 2026
Hi @JetteBke, thanks for the detailed report!
Both errors come from the DevLake backend (the SonarQube plugin's migration scripts), not from the Helm chart, so there is nothing to change in the chart itself.
idx__tool_sonarqube_issue_code_blocks_componentdoes not exist: already fixed in fix(sonarqube): tolerate missing migration indexes devlake#9012._tool_sonarqube_file_metrics_pkeydoes not exist: I couldn't reproduce this on a truly fresh database. It happens when that migration is interrupted after it has dropped the primary key but before it is recorded as done (for example, the pod is restarted mid-migration). On the next start the migration runs again and fails because the key is already gone. MySQL has the same problem. I opened [Bug][SonarQube] Migration 20230927145127 is not re-runnable: fails with "constraint _tool_sonarqube_file_metrics_pkey does not exist" after an interrupted run devlake#9241 for it, and the fix is in fix(sonarqube): make file_metrics_key length migration re-runnable devlake#9242.Please follow apache/devlake#9242. Once it is merged and included in a release, you should be able to drop the workaround that excludes the sonarqube plugin.