Sonarqube - Getting error while upgrading new version 7.4 : -Error DB migration ended with an exception

sonarqube

(Banupriya) #1

Hi All,

Good Evening!!

I’m trying to upgrading new version from 6.7.6 to 7.4 and I got the below error.
Please help the same.

Thanks in advance.

Note : Before upgrading the version 7.4, we have upgraded the version 6.7.6 (LTS latest version) from version 6.5

Log Details :

2019.02.05 17:39:13 INFO  web[][o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2019.02.05 17:39:13 INFO  web[][DbMigrations] Executing DB migrations...
2019.02.05 17:39:13 INFO  web[][DbMigrations] #1907 'Populate table live_measures'...
2019.02.05 17:40:13 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 357749 live measures processed (5962 items/sec)
2019.02.05 17:41:13 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 632499 live measures processed (4579 items/sec)
2019.02.05 17:41:25 ERROR web[][DbMigrations] #1907 'Populate table live_measures': failure | time=131322ms
2019.02.05 17:41:25 ERROR web[][DbMigrations] Executed DB migrations: failure | time=131326ms
2019.02.05 17:41:25 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=131402ms
2019.02.05 17:41:25 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 #1907 'Populate table live_measures' 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.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.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
        at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Error during processing of row: [uuid=a35c0951-ecbb-4e86-9720-ff302a943b25,project_uuid=bb770f88-9ff4-4926-b1e4-1b94d12680b5,metric_id=57,value=0E-20,text_value=null,variation_value_1=0E-20,measure_data=null]
        at org.sonar.server.platform.db.migration.step.SelectImpl.newExceptionWithRowDetails(SelectImpl.java:89)
        ... 9 common frames omitted
Caused by: java.sql.BatchUpdateException: Cannot insert duplicate key row in object 'dbo.live_measures' with unique index 'live_measures_component'. The duplicate key value is (a35c0951-ecbb-4e86-9720-ff302a943b25, 10).
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2303)
        at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:223)
        at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:223)
        at org.sonar.server.platform.db.migration.step.UpsertImpl.addBatch(UpsertImpl.java:56)
        at org.sonar.server.platform.db.migration.step.MassUpdate.callSingleHandler(MassUpdate.java:119)
        at org.sonar.server.platform.db.migration.step.MassUpdate.lambda$execute$0(MassUpdate.java:92)
        at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:78)
        ... 13 common frames omitted
2019.02.05 17:53:56 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalArgumentException: Unable to create shared memory :
        at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:100)
        at org.sonar.process.sharedmemoryfile.DefaultProcessCommands.<init>(DefaultProcessCommands.java:34)
        at org.sonar.process.sharedmemoryfile.DefaultProcessCommands.secondary(DefaultProcessCommands.java:52)
        at org.sonar.server.app.WebServer.isOperational(WebServer.java:68)
        at org.sonar.server.app.WebServer.getStatus(WebServer.java:60)
        at org.sonar.process.ProcessEntryPoint.waitForOperational(ProcessEntryPoint.java:145)
        at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:120)
        at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:100)
        at org.sonar.server.app.WebServer.main(WebServer.java:91)
Caused by: java.io.FileNotFoundException: /data/sonarqube-7.4/temp/sharedmemory (Permission denied)
        at java.io.RandomAccessFile.open0(Native Method)
        at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
        at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:97)
        ... 8 common frames omitted

        at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:81)
        at org.sonar.server.platform.db.migration.step.MassUpdate.execute(MassUpdate.java:92)
        at org.sonar.server.platform.db.migration.version.v70.PopulateLiveMeasures.execute(PopulateLiveMeasures.java:57)
        at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:45)
        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
        ... 9 common frames omitted

(G Ann Campbell) #2

Hi,

This log line looks suspicious to me:

Caused by: java.io.FileNotFoundException: /data/sonarqube-7.4/temp/sharedmemory (Permission denied)

Does the account running SonarQube have rwx permissions to that directory, recursively? Do you have a virus scanner running on the machine?

 
Ann