Hi Team,
I am trying to setup fresh SonarQube on Kubernetes platform and getting some errors.
SonarQube version being used: 7.9.4
DB used: AWS RDS (PostgreSQL- Engine Version: 12.5)
As per pod logs, I am getting below error after creating fresh PostgreSQL DB
2021.05.06 07:01:14 ERROR web[][o.s.s.p.Platform] Web server startup failed: Current version is too old. Please upgrade to Long Term Support version firstly.
Google searches suggest that this error would appear when you try to upgrade sonar versions. But I am trying to set fresh setup, not any upgrades.
However, I came across below article that suggests that table named “schema_migrations” shouldn’t contain any data.
As I checked on DB, I was getting some data for this table.
Hence I deleted everything from this table.
SONAR=> SELECT * FROM schema_migrations;
version
---------
1
2
1153
1200
1205
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
(23 rows)
SONAR=>
SONAR=> DELETE FROM schema_migrations;
DELETE 23
SONAR=> SELECT * FROM schema_migrations;
version
---------
(0 rows)
I deleted the pod and created new pod again and I am getting errors as below:
2021.05.06 08:20:52 ERROR web[][DbMigrations] #1 'Create initial schema': failure | time=271ms
2021.05.06 08:20:52 ERROR web[][DbMigrations] Executed DB migrations: failure | time=272ms
2021.05.06 08:20:52 ERROR web[][o.s.s.p.Platform] Web server startup failed
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1 'Create initial schema' 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 java.base/java.lang.Iterable.forEach(Unknown Source)
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.AutoDbMigration.start(AutoDbMigration.java:121)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
at org.sonar.server.platform.Platform.start(Platform.java:211)
at org.sonar.server.platform.Platform.startSafeModeContainer(Platform.java:203)
at org.sonar.server.platform.Platform.doStart(Platform.java:104)
at org.sonar.server.platform.Platform.doStart(Platform.java:95)
at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:44)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4817)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5283)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
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 CREATE TABLE active_dashboards (id SERIAL NOT NULL,dashboard_id INTEGER NOT NULL,user_id INTEGER NULL,order_index INTEGER NULL, CONSTRAINT pk_active_dashboards PRIMARY KEY (id))
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:97)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:77)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:117)
at org.sonar.server.platform.db.migration.version.v56.CreateInitialSchema.createActiveDashboards(CreateInitialSchema.java:512)
at org.sonar.server.platform.db.migration.version.v56.CreateInitialSchema.execute(CreateInitialSchema.java:51)
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)
... 29 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: relation "active_dashboards" already exists
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:82)
... 35 common frames omitted
Can anyone please help me to resolve the issue ?
Thanks,
Vaibhav Jariwala