Need help getting PR decorations working upgrading from 6.7.3 to 7.6


(Joseph Morais) #1

Hello all,

Previously on 6.73 we used the GitHub plugin for PR decoration via sonar.analysis.mode=issues. We are currently evaluating 7.6’s PR Analysis mode to see which our developers prefer. I believe I have everything correctly setup. Here are details:

SonarQube running latest version
I have tried this with both SonarQube Scanner 3.3.0.1492 and SonarQube Scanner 3.0.3.778.

We launch the scanner via Jenkins slave using this line:

/opt/sonar-scanner/bin/sonar-scanner -X -Dsonar.pullrequest.github.repository=repo/repo-name -Dsonar.pullrequest.branch=test-sonar76 -Dsonar.pullrequest.key=21811 -Dsonar.pullrequest.base=master -Dsonar.modules=backend

I think we have all of the correct switches to evoke that mode. In the output I see:

03:01:37.761 DEBUG: Found manual configuration of branch/PR analysis. Skipping automatic configuration.

However we go no decoration (I did setup the Pull Request section of SonarQube). I think these messages are related:

03:01:38.970 DEBUG: SCM Step is disabled by configuration
03:01:38.996 DEBUG: SCM information about changed files in the branch is not available
03:04:24.675 INFO: SCM Publisher is disabled

This is due to to sonar.scm.disabled being enabled on the server. When I disabled sonar.scm.disabled, we started getting this error:

03:26:29.737 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:355)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.FileIndexer

I have updated all plugins to latest, then went from SonarScanner 3.0.3.778 to 3.3.0.1492 they both have the same issue once SCM scanning is enabled.

Any help would be greatly appreciated.