JetBrains / TeamCity.SonarQubePlugin

A plugin for TeamCity server allowing you to configure and run SonarQube analysis from the CI
Apache License 2.0
53 stars 32 forks source link

Error during Sonar runner execution #35

Closed aixasz closed 6 years ago

aixasz commented 7 years ago

We have custom Roslyn analyzer for analyze our code and then we use sonarqube-roslyn-sdk to generate plugin for SonarQube.

And we got the error when run teamcity build after activated the rules from custom roslyn analyzer in SonarQube server.

TeamCity : 9.1.6 SonarQube : 5.6

[13:39:28][Step 11/12] 13:39:28.591 INFO  - All FxCop rules are disabled, skipping its execution.
[13:39:28][Step 11/12] 13:39:28.947 DEBUG - 'JavaScript Squid Sensor' skipped because there is no related file in current project
[13:39:28][Step 11/12] 13:39:28.948 DEBUG - Sensors : org.sonar.plugins.csharp.CSharpSensor@1a6d664
[13:39:28][Step 11/12] 13:39:28.948 INFO  - Sensor org.sonar.plugins.csharp.CSharpSensor
[13:39:28][Step 11/12] 13:39:28.948 WARN  - ***********************************************************************************
[13:39:28][Step 11/12] 13:39:28.948 WARN  - *                 Use MSBuild 14 to get the best analysis results                 *
[13:39:28][Step 11/12] 13:39:28.948 WARN  - * The use of MSBuild 12 or the sonar-scanner to analyze C# projects is DEPRECATED *
[13:39:28][Step 11/12] 13:39:28.948 WARN  - ***********************************************************************************
[13:39:29][Step 11/12] INFO: ------------------------------------------------------------------------
[13:39:29][Step 11/12] INFO: EXECUTION FAILURE
[13:39:29][Step 11/12] INFO: ------------------------------------------------------------------------
[13:39:29][Step 11/12] Total time: 10.135s
[13:39:29][Step 11/12] ERROR: Error during Sonar runner execution
[13:39:29][Step 11/12] org.sonar.runner.impl.RunnerException: Unable to execute Sonar
[13:39:29][Step 11/12] Final Memory: 9M/107M
[13:39:29][Step 11/12]  at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
[13:39:29][Step 11/12] INFO: ------------------------------------------------------------------------
[13:39:29][Step 11/12]  at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
[13:39:29][Step 11/12]  at java.security.AccessController.doPrivileged(Native Method)
[13:39:29][Step 11/12]  at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
[13:39:29][Step 11/12]  at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
[13:39:29][Step 11/12]  at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
[13:39:29][Step 11/12]  at org.sonar.runner.api.Runner.execute(Runner.java:100)
[13:39:29][Step 11/12]  at org.sonar.runner.Main.executeTask(Main.java:70)
[13:39:29][Step 11/12]  at org.sonar.runner.Main.execute(Main.java:59)
[13:39:29][Step 11/12]  at org.sonar.runner.Main.main(Main.java:53)
[13:39:29][Step 11/12] Caused by: java.lang.IllegalArgumentException: Custom and 3rd party Roslyn analyzers are only by MSBuild 14. Either use MSBuild 14, or disable the custom/3rd party Roslyn analyzers in your quality profile.
[13:39:29][Step 11/12]  at org.sonar.plugins.csharp.CSharpSensor.analyze(CSharpSensor.java:126)
[13:39:29][Step 11/12]  at org.sonar.plugins.csharp.CSharpSensor.analyse(CSharpSensor.java:109)
[13:39:29][Step 11/12]  at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
[13:39:29][Step 11/12]  at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
[13:39:29][Step 11/12]  at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
[13:39:29][Step 11/12]  at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
[13:39:29][Step 11/12]  at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[13:39:29][Step 11/12]  at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[13:39:29][Step 11/12]  at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
[13:39:29][Step 11/12]  at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
[13:39:29][Step 11/12]  at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
[13:39:29][Step 11/12]  at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[13:39:29][Step 11/12]  at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[13:39:29][Step 11/12]  at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
[13:39:29][Step 11/12]  at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[13:39:29][Step 11/12]  at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[13:39:29][Step 11/12]  at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[13:39:29][Step 11/12]  at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
[13:39:29][Step 11/12]  at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[13:39:29][Step 11/12]  at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
[13:39:29][Step 11/12]  at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
[13:39:29][Step 11/12]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[13:39:29][Step 11/12]  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[13:39:29][Step 11/12]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[13:39:29][Step 11/12]  at java.lang.reflect.Method.invoke(Unknown Source)
[13:39:29][Step 11/12]  at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
[13:39:29][Step 11/12]  ... 9 more
[13:39:29][Step 11/12] Process exited with code 1
[13:39:29][Step 11/12] Step SonarQube Runner failed
Linfar commented 7 years ago

As the log mentions custom Roslyn analyzers are supported only by MSBuild 14. Currently TeamCity doesn't support it. Adding support for MSBuild is planned so I'll speed it up.

aixasz commented 7 years ago

@Linfar Thank you.

benranck commented 7 years ago

@Linfar is there any movement on adding MSBuild support?

Linfar commented 7 years ago

@benranck Unfortunately, not much. I'll switch back to it when possible.

benranck commented 7 years ago

@Linfar if there's any way that we can help, please let us know as we'd be happy to assist where we can.

ghost commented 7 years ago

Hi @Linfar I faced the same issue today, is there any solution planned soon? Thanks

slavapr commented 7 years ago

@Linfar any updates? do you have any workaround?

Linfar commented 7 years ago

Sorry for long responding. For information on MSBuild Scanner support visit other thread

Linfar commented 6 years ago

The MSBuild Scanner is now supported, please update the plugin and notify me if anything goes wrong

aixasz commented 6 years ago

@Linfar Thank you.