7.9.1 Developer Edition cannot be started

Template for a good bug report, formatted with Markdown:

  • versions used Sonarqube 7.9.1 Devloper Edition
  • error observed
    org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #2123 'Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_ACTIVITY' failed
  • steps to reproduce
    start sonarqube with a new empty database via
java -jar lib/sonar-application-$SONAR_VERSION.jar \
  -Dsonar.log.console=true \
  -Dsonar.jdbc.username="$SONARQUBE_JDBC_USERNAME" \
  -Dsonar.jdbc.password="$SONARQUBE_JDBC_PASSWORD" \
  -Dsonar.jdbc.url="$SONARQUBE_JDBC_URL" \
  -Dsonar.web.javaAdditionalOpts="$SONARQUBE_WEB_JVM_OPTS -Djava.security.egd=file:/dev/./urandom" \
  "${sq_opts[@]}" \
  "$@"
  • potential workaround

Hi,

Can you double check that your env vars really are pointing SonarQube to an empty DB? It shouldn’t be attempting migration in that situation.

 
Ann

Hi,

I decided to use an existing sonardb and had no problems anymore.

SonarQube version - 7.9.1
PostgreSQL version - 10.9

Database migration fails during the 7.9 version installation with an empty database, because submitter_login column doesn’t exists.

Logs:

2019.10.10 14:52:01 INFO web[][o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart

2019.10.10 14:52:01 INFO web[][DbMigrations] Executing DB migrations...

2019.10.10 14:52:01 INFO web[][DbMigrations] #2123 'Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_ACTIVITY'...

2019.10.10 14:52:01 ERROR web[][DbMigrations] #2123 'Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_ACTIVITY': failure | time=15ms

2019.10.10 14:52:01 ERROR web[][DbMigrations] Executed DB migrations: failure | time=18ms

2019.10.10 14:52:01 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=200ms

2019.10.10 14:52:01 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 #2123 'Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_ACTIVITY' 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.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 ce_activity RENAME COLUMN submitter_login TO submitter_uuid

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.v72.RenameSubmitterLoginToSubmitterUuidOnTableCeActivity.execute(RenameSubmitterLoginToSubmitterUuidOnTableCeActivity.java:41)

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: ERROR: column "submitter_login" does not exist

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)

... 14 common frames omitted

I have fixed this issue by installation of the previous SonarQube version (6.7.6) and then upgrading to 7.9.1

Please, verify source code for database migration.

Hello @Jens_Hammel,

Let me ask you a few clarification questions:

  1. why are you starting Sonarqube with java -jar? This is not our recommended way of starting SonarQube and we provide scripts to deal with SQ’s start, stop, restart, etc. You should use those.
  2. the command line you pasted suspiciously is exactly the same as the command line used in the Docker image of SonarQube community edition. Are you using Docker and not saying so? Did you just get inspired by it?
  3. the command line you shared contains extra variables on top of JDBC ones ("${sq_opts[@]}" and "$@"). What are their values? If more parameter can be added to the command line, this could other JDBC settings which may overwrite the first ones or other side effects.

If you’re using Docker, please provide the full picture of your problem (docker run command at least).
Either way, please provide the actual command line you are using.
Finally, please provide more logs that just this light extract.

Cheers,

A post was merged into an existing topic: Dev edition as docker image

This was the right topic @ganncamp. It is not about the vm max count but about the error thrown during db migration on an empty db. I am only giving extra parameters that I have entered. I will edit question to make it clearer.

Is there a fix for this issue other than updating an older system? This problem only occurs in the LTS version when I first deploy my docker image. Some logs:

2019.11.04 18:06:13 INFO web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8 
2019.11.04 18:06:14 INFO web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install 
2019.11.04 18:06:15 INFO web[][DbMigrations] Executing DB migrations... 
2019.11.04 18:06:15 INFO web[][DbMigrations] #1 'Create initial schema'... 
2019.11.04 18:06:17 INFO web[][DbMigrations] #1 'Create initial schema': success | time=1262ms 
2019.11.04 18:06:17 INFO web[][DbMigrations] #2 'Populate initial schema'... 
2019.11.04 18:06:17 INFO web[][DbMigrations] #2 'Populate initial schema': success | time=118ms 
2019.11.04 18:06:17 INFO web[][DbMigrations] #1153 'Populate columns USERS.EXTERNAL_IDENTITY_*'... 
2019.11.04 18:06:17 INFO web[][o.s.s.p.d.m.s.MassUpdate] 0 users processed (0 items/sec)`
…
…
2019.11.04 18:06:26 INFO web[][DbMigrations] #2122 'Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_QUEUE': success | time=4ms 
2019.11.04 18:06:26 INFO web[][DbMigrations] #2123 'Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_ACTIVITY'... 
2019.11.04 18:06:26 ERROR web[][DbMigrations] #2123 'Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_ACTIVITY': failure | time=70ms 
2019.11.04 18:06:26 ERROR web[][DbMigrations] Executed DB migrations: failure | time=10959ms 
2019.11.04 18:06:26 ERROR web[][o.s.s.p.Platform] Web server startup failed`

Hi @Luke_C,

Welcome to the community!

Sorry if I misunderstood and moved your previous post in error. I believe your previous post mentioned that you’re using Docker? And if so, could you share your start command? Also, could you verify that you really were pointing to an empty DB when you first started?

 
Ann

Thanks for answering @ganncamp.

I am using the container in kubernetes. I don’t supply any start commands and only provide the JDBC_$VARS as configuration. I have just deleted the database and recreated it. This is a first time setup on google cloud and there is no data in the db yet.

So… you deleted and recreated the database… and then what? Did startup go okay?

Unfortunately not.

2019.11.04 19:41:31 ERROR web[DbMigrations] #2123 ‘Rename SUBMITTER_LOGIN TO SUBMITTER_UUID on table CE_ACTIVITY’: failure

It has failed on that step each time.

I also just deleted the db and create a new one and changed the image from 7.9 to 6.7.7 and where the result is:

2019.11.04 19:46:17 INFO web[][DbMigrations] Executed DB migrations: success | time=9142ms

@ganncamp

This appears to be a resource issue within kubernetes. I removed the resource restrictions of sonarqube and it has succesfully deployed a sonarqube instance. I will continue to fine-tune this as unrestricted resource usage isn’t desirable even if elasticsearch is awesome. Thanks again for your time and congrats on 8.0!

Hi @Luke_C,

I’m confused. Your database migration error went away after you removed resource restrictions?

 
Ann

Yes I cant explain it either but I’m investigating. That is the only change I made and then it worked.