Versions:
- SonarQube Docker image version: sonarqube:8.9-community
- PostgreSQL 12
Error:
Upon starting up a container running an aformentioned SonaQube image, it fills the public schema of Postgres database sonar with the following tables:
|table_name |
|-------------------------|
|schema_migrations |
|active_rule_parameters |
|active_rules |
|alm_app_installs |
|analysis_properties |
|ce_activity |
|ce_queue |
|ce_scanner_context |
|ce_task_characteristics |
|ce_task_input |
|ce_task_message |
|default_qprofiles |
|deprecated_rule_keys |
|duplications_index |
|es_queue |
|event_component_changes |
|events |
|file_sources |
|group_roles |
|groups |
|internal_component_props |
|issue_changes |
|issues |
|live_measures |
|manual_measures |
|metrics |
|notifications |
|org_qprofiles |
|org_quality_gates |
|organization_alm_bindings|
|project_branches |
|perm_templates_groups |
|perm_templates_users |
|perm_tpl_characteristics |
|permission_templates |
|plugins |
|project_alm_bindings |
|organizations |
|project_links |
|project_mappings |
|project_measures |
|project_qprofiles |
|projects |
|qprofile_changes |
When I then attempt to enter SonarQube web interface from browser, it prompts me to upgrade, so do the logs:
The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
When I try to upgrade I am faced with the following error in the logs:
2021.09.08 09:35:14 INFO web[][o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2021.09.08 09:35:14 INFO web[][DbMigrations] Executing DB migrations...
2021.09.08 09:35:14 INFO web[][DbMigrations] #3204 'Rename table 'PROJECTS' to 'COMPONENTS''...
2021.09.08 09:35:14 ERROR web[][DbMigrations] #3204 'Rename table 'PROJECTS' to 'COMPONENTS'': failure | time=13ms
2021.09.08 09:35:14 ERROR web[][DbMigrations] Executed DB migrations: failure | time=17ms
2021.09.08 09:35:14 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=105ms
2021.09.08 09:35:14 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #3204 'Rename table 'PROJECTS' to 'COMPONENTS'' failed
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:405)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:68)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Fail to execute ALTER TABLE projects RENAME TO components
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:106)
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:86)
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:128)
at org.sonar.server.platform.db.migration.version.v82.RenameProjectsTableToComponents.execute(RenameProjectsTableToComponents.java:33)
at org.sonar.server.platform.db.migration.step.DdlChange.execute(DdlChange.java:45)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
... 9 common frames omitted
Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:350)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:322)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:308)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:284)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:279)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:91)
... 14 common frames omitted
Caused by: java.io.EOFException: null
at org.postgresql.core.PGStream.receiveChar(PGStream.java:445)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2057)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
... 23 common frames omitted
I attempted to grant accesses to the database user sonarqube uses, I also attempted to fit the sonarqube with the admin database user to no avail. Can you point me to what I might be doing wrong?