Errors after upgrading to Sonar 5.3 from 5.0

784 views
Skip to first unread message

gruss...@gmail.com

unread,
Mar 3, 2016, 5:08:38 AM3/3/16
to SonarQube, Graham Russell
Hi,

I recently attempted to upgrade Sonar from 5.0 to 5.3 and had a number of problems to overcome and I eventually had to rollback.

We use a SQL database called SonarQube, after renaming the database to Sonar the database upgrade failed, this was eventually resolved by manually adding an index to the Sonar database:  http://stackoverflow.com/questions/34858239/sonarqube-5-2-upgrade-to-5-3-fail-to-execute-drop-index-unique-schema-migrations

The plug-ins we use in Sonar 5.0 were:
  • sonar-build-breaker-plugin-1.1.jar
  • sonar-csharp-plugin-3.3.jar
  • sonar-javascript-plugin-2.5.jar
  • sonar-ldap-plugin-1.4.jar
  • sonar-salesforce-plugin-3.3.jar
  • sonar-sonargraph-plugin-3.4.1.jar
  • sonar-stylecop-plugin-1.1.jar
  • sonar-visual-studio-plugin-1.2.jar
I upgraded the following plugins (and removed the older versions):
  • sonar-build-breaker-plugin-2.0.jar
  • sonar-csharp-plugin-4.5.jar
  • sonar-javascript-plugin-2.10.jar

The C# plugin required the C# build agents to have .Net 4.5.2 installed.

After running a build (via TeamCity) on a build agent with .Net 4.6 installed sonar stated an error:

....
[19:53:37] : [Exec] 19:53:37.398 DEBUG - Upload report
[19:53:37] : [Exec] 19:53:37.713 DEBUG - POST 200 http://<MySonarServer>:9000/api/ce/submit?projectKey=*****.Product&projectName=*****%20*****%20Product | time=312ms
[19:53:37] : [Exec] 19:53:37.721 INFO  - Analysis report uploaded in 323ms
[19:53:37] : [Exec] 19:53:37.723 INFO  - ANALYSIS SUCCESSFUL, you can browse http://<MySonarServer>:9000/dashboard/index/*****.Product
[19:53:37] : [Exec] 19:53:37.723 INFO  - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[19:53:37] : [Exec] 19:53:37.723 INFO  - More about the report processing at http://<MySonarServer>:9000/api/ce/task?id=AVM45JO0IaorHcNZHTND
[19:53:37] : [Exec] 19:53:37.744 DEBUG - Report metadata written to F:\TeamCity\buildAgent\work\a2e9533bd348fbbc\source\.\.sonar\report-task.txt
[19:53:37] : [Exec] 19:53:37.750 DEBUG - Post-jobs : org.sonar.plugins.buildbreaker.ForbiddenConfigurationBreaker@30af14 -> org.sonar.plugins.buildbreaker.QualityGateBreaker@365a8e
[19:53:37] : [Exec] 19:53:37.750 INFO  - Executing post-job org.sonar.plugins.buildbreaker.ForbiddenConfigurationBreaker
[19:53:37] : [Exec] 19:53:37.752 INFO  - Executing post-job org.sonar.plugins.buildbreaker.QualityGateBreaker
[19:53:38] : [Exec] 19:53:38.275 INFO  - Waiting for report processing to complete...
[19:53:48] : [Exec] 19:53:48.359 INFO  - Waiting for report processing to complete...
[19:53:58] : [Exec] 19:53:58.454 INFO  - Analysis report generated in F:\TeamCity\buildAgent\work\a2e9533bd348fbbc\source\.\.sonar\batch-report
[19:53:58] : [Exec] INFO: ------------------------------------------------------------------------
[19:53:58] : [Exec] INFO: EXECUTION FAILURE
[19:53:58] : [Exec] INFO: ------------------------------------------------------------------------
[19:53:58] : [Exec] Total time: 12:28.997s
[19:53:59] : [Exec] Final Memory: 7M/122M
[19:53:59] : [Exec] INFO: ------------------------------------------------------------------------
[19:53:59]E: [Exec] EXEC Error during Sonar runner execution
[19:53:59] : [Exec] org.sonar.runner.impl.RunnerException: Unable to execute Sonar
[19:53:59] : [Exec] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
[19:53:59] : [Exec] at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
[19:53:59] : [Exec] at java.security.AccessController.doPrivileged(Native Method)
[19:53:59] : [Exec] at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
[19:53:59] : [Exec] at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
[19:53:59] : [Exec] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
[19:53:59] : [Exec] at org.sonar.runner.api.Runner.execute(Runner.java:100)
[19:53:59] : [Exec] at org.sonar.runner.Main.executeTask(Main.java:70)
[19:53:59] : [Exec] at org.sonar.runner.Main.execute(Main.java:59)
[19:53:59] : [Exec] at org.sonar.runner.Main.main(Main.java:53)
[19:53:59] : [Exec] Caused by: java.lang.IllegalStateException: Report processing did not complete successfully: FAILED
[19:53:59] : [Exec] at org.sonar.plugins.buildbreaker.QualityGateBreaker.getAnalysisId(QualityGateBreaker.java:138)
[19:53:59] : [Exec] at org.sonar.plugins.buildbreaker.QualityGateBreaker.execute(QualityGateBreaker.java:94)
[19:53:59] : [Exec] at org.sonar.plugins.buildbreaker.QualityGateBreaker.executeOn(QualityGateBreaker.java:81)
[19:53:59] : [Exec] at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:65)
[19:53:59] : [Exec] at org.sonar.batch.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
[19:53:59] : [Exec] at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:107)
[19:53:59] : [Exec] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
[19:53:59] : [Exec] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
[19:53:59] : [Exec] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
[19:53:59] : [Exec] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
[19:53:59] : [Exec] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
[19:53:59] : [Exec] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
[19:53:59] : [Exec] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
[19:53:59] : [Exec] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
[19:53:59] : [Exec] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
[19:53:59] : [Exec] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[19:53:59] : [Exec] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
[19:53:59] : [Exec] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
[19:53:59] : [Exec] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
[19:53:59] : [Exec] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[19:53:59] : [Exec] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
[19:53:59] : [Exec] at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
[19:53:59] : [Exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[19:53:59] : [Exec] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[19:53:59] : [Exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[19:53:59] : [Exec] at java.lang.reflect.Method.invoke(Unknown Source)
[19:53:59] : [Exec] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
[19:53:59] : [Exec] ... 9 more
[19:53:59]E: [Exec] F:\TeamCity\buildAgent\work\a2e9533bd348fbbc\source\BuildScripts\CodeQualityAnalysis.proj(9, 5): error MSB3073: The command ""F:\Sonar\Sonar-Runner-2.4\bin\sonar-runner" -X" exited with code 1.

The code was a repeat of a build that passed the Sonar 5.0 quality gates.

Any help would be appreciated, thanks.

Julien Lancelot

unread,
Mar 3, 2016, 7:34:27 AM3/3/16
to gruss...@gmail.com, SonarQube, Graham Russell
Hi,

Could you please try to remove the sonar-build-breaker-plugin and check that every think is working fine ?

Regards,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/61b914a3-7dc6-4d5c-a605-808e4cbe2aa3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Julien LANCELOT | SonarSource

gruss...@gmail.com

unread,
Mar 4, 2016, 5:23:16 AM3/4/16
to SonarQube, gra...@denplan.co.uk, gruss...@gmail.com

Thanks, I'm currently creating a clone of our live server to test the upgrade again without the plugin.

Looking at the stack trace it very much does look like the problem is with that plug-in (that we need for our CD pipeline), so we're looking at the source to see if we can identify the reason.

Julien Lancelot

unread,
Mar 4, 2016, 7:41:32 AM3/4/16
to gruss...@gmail.com, SonarQube, gra...@denplan.co.uk
Hi,

In fact there's no problem with the plugin, I've asked to remove it in order to be sure that everything else is working correctly.

If the analysis by the scanner of the problem is working, then you'll now need to see in the server the logs of the background task (http://docs.sonarqube.org/display/SONAR/Background+Tasks) of this project, as it's most probably red (that's why the buildbreaker plugin response is "Caused by: java.lang.IllegalStateException: Report processing did not complete successfully: FAILED").

Regards,


On Fri, 4 Mar 2016 at 11:23 <gruss...@gmail.com> wrote:

Thanks, I'm currently creating a clone of our live server to test the upgrade again without the plugin.

Looking at the stack trace it very much does look like the problem is with that plug-in (that we need for our CD pipeline), so we're looking at the source to see if we can identify the reason.

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

gruss...@gmail.com

unread,
Mar 11, 2016, 4:58:41 AM3/11/16
to SonarQube, gruss...@gmail.com, gra...@denplan.co.uk

Hi,

I have setup a test server so that I can test the migration rather than do it in live and got the same error as before (I haven't tried removing the Quality Gate plugin yet).

Upon looking at the background task log that you suggested I found the following errors:

2016.03.10 18:18:50 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVNhwDS1Dl0VPvfkcFP_
org.sonar.server.computation.component.VisitException: Visit of Component {key=Denplan.Finance,type=PROJECT} failed
at org.sonar.server.computation.component.VisitException.rethrowOrWrap(VisitException.java:44) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:42) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.step.QualityGateMeasuresStep.execute(QualityGateMeasuresStep.java:81) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:72) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-5.3.jar:na]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_45]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_45]
Caused by: java.lang.UnsupportedOperationException: QualityGate status can not be changed if already set on source Measure

It looks like this is a known issue which looks to be resolved in version 5.6:  https://jira.sonarsource.com/browse/SONAR-7276

Thanks for your help.
Reply all
Reply to author
Forward
0 new messages