- which versions are you using
→ Currently we are using version sonarqube 7.8
- how is SonarQube deployed: zip, Docker, Helm
→ Deployed with zip
- what are you trying to achieve
→ we are currently changing the database from Mysql to Postgresql. we have created new RDS of Postgresql with version 13.12, we have migrated data from mysql to postgresql using AWS DMS. After migration we have connected postgresql to sonar- instance but we are facing multiple issues like sonar instance is hard stopping after the connection
Also, we want to know if sonar code base already have migration script which automatically migrates data after changing the database, if not, currently our logs suggests after the changing the database migration is happening and we are not able to locate the migration script that has been used here.
- what have you tried so far to achieve this
we tried dropping one table notification but again we are facing same issue for different tables
Attaching the logs below
2024.05.08 14:44:16 INFO web[][o.s.p.ProcessEntryPoint] Gracefully stopping process
2024.05.08 14:44:16 INFO web[][o.s.s.n.NotificationDaemon] Notification service stopped
2024.05.08 14:44:16 INFO web[][o.s.s.app.WebServer] WebServer stopped
2024.05.08 14:44:40 INFO web[][o.s.p.ProcessEntryPoint] Starting web
2024.05.08 14:44:41 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2024.05.08 14:44:42 INFO web[][o.s.c.e.CoreExtensionsLoader] Loaded core extensions: Community Branch Plugin
2024.05.08 14:44:42 INFO web[][o.e.p.PluginsService] no modules loaded
2024.05.08 14:44:42 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2024.05.08 14:44:42 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2024.05.08 14:44:42 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2024.05.08 14:44:44 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2024.05.08 14:44:44 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 7.8.0.26217 / daf4da5c554d4153a11e68d13a662313e6cecc92
2024.05.08 14:44:44 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://sonar-stage-db-cluster.cluster-cmze5sxav8n7.eu-west-1.rds.amazonaws.com:5432/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false&max_allowed_packet=50M
2024.05.08 14:44:46 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube-7.8
2024.05.08 14:44:46 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2024.05.08 14:44:46 INFO web[][o.s.s.p.d.m.h.MigrationHistoryTableImpl] Creating table schema_migrations
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin AEM Rules for SonarQube / 1.3
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Community Branch Plugin / 1.2.0
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.8.0.1574 / aec3dc8f5228aabd218e1cd31ac6e6515a43715d
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin GitHub Authentication for SonarQube / 1.5.0.870 / 153f7c7af7a264adb0fcbe5fee87bdd140a6a3a1
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin JaCoCo / 1.0.1.143 / 65c55e41e32c114704fd597ccea91fc55becb4ec
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin LDAP / 2.2.0.608 / 79dc3fa4393a29667673c70182f3016288b548b7
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SAML 2.0 Authentication for SonarQube / 1.1.0.181 / 16fcb5be2d3bcfee8920b29cd758d8b957a18acb
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarC# / 7.14.0.8411 / 6b1f3f2cfd9555d0683bf65f400f0acc48452adb
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarCSS / 1.1.0.993 / ebac7cd722f1f455344f46bd3581a3ba4cfd9003
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarFlex / 2.4.0.1222 / 68d9cb3b7daccbc4869c4f2b89d09218d26a0829
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarGo / 1.1.1.2000 / 40d55921c7a63b67386a053490d17b6723a46cd5
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarHTML / 3.1.0.1615 / 4181edb5eff5605bec82dc0aa15ecd70eaa5857f
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 5.2.1.7778 / 49f34eaeaad59868d4353d89b1fc5c02bbe51976
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava / 5.13.0.18197 / 35e70591626e1b27bb059f795dda0327c02a09d3
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarKotlin / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP / 3.1.1.4762 / b5f6f72ed396a6908fd2622a7ef141fde816ee9c
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython / 1.14.0.3086 / a6ac95b01b57bfb5f4ca604b4234595bb9f04b7e
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarRuby / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarScala / 1.5.0.315 / 4ff3a145a58f3f84f1b39846a205a129d742e993
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 1.9.0.3766 / 4a4080b78001a78d758d1d0fa0190fb9496b6f57
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarVB / 7.14.0.8411 / 6b1f3f2cfd9555d0683bf65f400f0acc48452adb
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML / 2.0.1.2020 / c5b84004face582d56f110e24c29bf9c6a679e69
2024.05.08 14:44:47 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Svn / 1.9.0.1295 / 942e075773975354e32691a60bfd968065703e04
2024.05.08 14:44:48 INFO web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2024.05.08 14:44:48 INFO web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install
2024.05.08 14:44:48 INFO web[][DbMigrations] Executing DB migrations...
2024.05.08 14:44:48 INFO web[][DbMigrations] #1 'Create initial schema'...
2024.05.08 14:44:49 ERROR web[][DbMigrations] #1 'Create initial schema': failure | time=1122ms
2024.05.08 14:44:49 ERROR web[][DbMigrations] Executed DB migrations: failure | time=1125ms
2024.05.08 14:44:49 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(Iterable.java:75)
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:62)
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(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Fail to execute CREATE TABLE notifications (id SERIAL NOT NULL,data BYTEA NULL, CONSTRAINT pk_notifications 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.createNotifications(CreateInitialSchema.java:524)
at org.sonar.server.platform.db.migration.version.v56.CreateInitialSchema.execute(CreateInitialSchema.java:74)
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 "notifications" 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
2024.05.08 14:44:49 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2024.05.08 14:44:49 INFO web[][o.s.p.ProcessEntryPoint] Hard stopping process
[ec2-user@ip-10-105-1-154 logs]$