Unable to process code using multiple C# Plugins

Hello All,

I have a custom Plugin for C# that needs to be run in the same project as the default C# built into SonarQube.
The Custom Plugin will only run when using SonarQube 7.9.4. So this is what is installed.
When I add the Custom plugin to the “C:\Sonarqube\sonarqube-7.9.4\extensions\plugins” directory AND remove the Sonar-C# Plugin, it loads fine.
When I remove the custom plugin and add back the default sonar-c# plugin, everything runs fine.
When I have BOTH the Custom Plugin AND the Default Sonar-C# plugin the server refuses to launch.

It looks like it’s launching, then ends with all services stopped.
Is there anything I can do to make the plugins play nice together?

-Ron

Here are the logs with the error.

2020.10.27 14:42:35 INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin StormfurySonarC# / 7.17-SNAPSHOT / d9bd23cd9641b234ab5da4aa7455f4162ff4b306
2020.10.27 14:42:35 INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin Svn / 1.9.0.1295 / 942e075773975354e32691a60bfd968065703e04
2020.10.27 14:42:35 INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin VB.NET Code Quality and Security / 8.6.1.17183 / e9f4299031df68d8c4be6ba670fd4c0395eebf76
2020.10.27 14:42:35 INFO  web[][o.s.s.p.ServerPluginRepository] Deploy plugin YAML Analyzer / 1.5.1
2020.10.27 14:42:36 WARN  web[][o.s.c.p.PluginLoader] Plugin SonarQube CNES Report [cnesreport] uses a child first classloader which is deprecated
2020.10.27 14:42:40 WARN  web[][o.a.c.u.SessionIdGeneratorBase] Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [406] milliseconds.
2020.10.27 14:42:40 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@49159ae9 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/properties*, ...]}]
2020.10.27 14:42:40 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2020.10.27 14:42:41 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.IllegalStateException: Fail to load plugin StormfurySonarC# [stormfurycsharp]
	at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:82)
	at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:543)
	at org.sonar.server.platform.Platform.start(Platform.java:211)
	at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185)
	at org.sonar.server.platform.Platform.access$500(Platform.java:46)
	at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119)
	at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
	at org.sonar.server.platform.Platform$1.doRun(Platform.java:119)
	at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Unable to register extension org.sonar.api.config.PropertyDefinition from plugin 'stormfurycsharp'
	at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:242)
	at org.sonar.server.plugins.ServerExtensionInstaller.installExtension(ServerExtensionInstaller.java:119)
	at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:74)
	... 9 common frames omitted
Caused by: org.picocontainer.PicoCompositionException: Duplicate Keys not allowed. Duplicate for 'org.sonar.api.config.PropertyDefinition-sonar.cs.roslyn.reportFilePaths'
	at org.picocontainer.DefaultPicoContainer.addAdapterInternal(DefaultPicoContainer.java:438)
	at org.picocontainer.DefaultPicoContainer.addAdapter(DefaultPicoContainer.java:459)
	at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:556)
	at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContainer.java:84)
	at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addComponent(DefaultPicoContainer.java:1149)
	at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:240)
	... 11 common frames omitted
2020.10.27 14:42:41 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2020.10.27 14:42:42 WARN  web[][o.s.p.ProcessEntryPoint$HardStopperThread] Can not stop in 1000ms
2020.10.27 14:42:42 WARN  web[][o.s.s.a.EmbeddedTomcat] Failed to stop web server
org.apache.catalina.LifecycleException: Failed to stop component [StandardServer[-1]]
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:238)
	at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:437)
	at org.sonar.server.app.EmbeddedTomcat.terminate(EmbeddedTomcat.java:104)
	at org.sonar.server.app.WebServer.hardStop(WebServer.java:83)
	at org.sonar.process.ProcessEntryPoint$HardStopperThread.lambda$new$0(ProcessEntryPoint.java:219)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardService[Tomcat]]
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:238)
	at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:814)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
	... 9 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Tomcat]]
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:238)
	at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:486)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
	... 11 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during stop
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1008)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)
	... 13 common frames omitted
2020.10.27 14:42:43 INFO  web[][o.s.s.p.d.EmbeddedDatabase] Embedded database stopped

Hi @RoBarnes - welcome to the community.

According to the log your plugin isn’t loading because of a duplicate property key:

Did you create your plugin by copying and modifying the SonarC# one?

Hi - no I did not. It was supplied to me. Is it possible to change the key in the sonar one to make the sonar one unique?

In short, no. The definition of sonar.cs.roslyn.reportFilePaths in the SonarC# plugin is the original definition. No plugin should duplicate a property key from another plugin.

You’ll need to talk the supplier of your custom plugin. It sounds like it’s incompatible with the SonarC# plugin.

Thank you very much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.