Closed jincod closed 3 years ago
Update:
I've dropped Flex plugin manually and restarted server. Now I'm getting error from PHP plugin
java.lang.IllegalStateException: The field 'maximumFunctionComplexityThreshold' does not exist or is not annotated with @RuleProperty in the class org.sonar.php.checks.HardCodedCredentialsCheck
at org.sonar.api.batch.rule.Checks.configureFields(Checks.java:178)
at org.sonar.api.batch.rule.Checks.instantiate(Checks.java:162)
at org.sonar.api.batch.rule.Checks.addAnnotatedChecks(Checks.java:136)
at org.sonar.plugins.php.PHPChecks.addChecks(PHPChecks.java:53)
at org.sonar.plugins.php.PHPSensor.<init>(PHPSensor.java:90)
at org.sonar.plugins.php.PHPSensor.<init>(PHPSensor.java:82)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:606)
at org.picocontainer.DefaultPicoContainer.getComponents(DefaultPicoContainer.java:587)
at org.sonar.core.platform.ComponentContainer.getComponentsByType(ComponentContainer.java:291)
at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.completeScannerExtensions(AbstractExtensionDictionnary.java:82)
at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getExtensions(AbstractExtensionDictionnary.java:77)
at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getFilteredExtensions(AbstractExtensionDictionnary.java:67)
at org.sonar.scanner.sensor.ModuleSensorExtensionDictionnary.selectSensors(ModuleSensorExtensionDictionnary.java:40)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$0(ModuleSensorsExecutor.java:52)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:52)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:385)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Similar problem when upgrading to previous LTS https://community.sonarsource.com/t/the-field-format-does-not-exist-or-is-not-annotated-with-ruleproperty/29633
Hello @jincod
Could you please provide the verbose logs (all of them - you can attach them in a file on the community forum https://community.sonarsource.com/c/help/8)?
To do so please run
SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true ...
as the begin step, and please attach the output of the BEGIN and END steps.
Do you have files with the .as
extension in your solution?
Thanks, Andrei
Hello @andrei-epure-sonarsource,
Do you have files with the .as extension in your solution?
No, we don't.
I am a bit puzzled by the logs you gave. The IllegalStateException
isn't present in the logs. And they seem to be missing information.
Even more, I see at the end EXECUTION FAILURE
but without any WARN
or ERROR
logs...
Could you help me understand what's happening here?
Acknowledged.
So the sensor fails when getting initialized.
The scanner doesn't really use the Flex or PHP plugin - the failure happens during initialization. Normally, the plugins should be initialized and then queried for the language extensions they support. But this failure happens before this step - when the class is actually initialized...
It seems such issues ocurred in the past:
Pending investigation.
@andrei-epure-sonarsource
Is ok that different languages have the same rule id?
Yes, the same rules are implemented in multiple languages. The rule repository differs (the fully qualified name for the rule is given by rule repository name + rule id).
Can you verify that all language plugins are only in SQ_FOLDER\lib\extensions
and the SQ_FOLDER\extensions\plugins
is empty (has only the README file)? This may be caused by old language plugins being around and confusing the scanner.
@andrei-epure-sonarsource correct
great, I am glad everything works now
No, I'm mean folder is empty. Plugins aren't duplicated.
The error is still presenting
could you please share the system info file with us? (https://support.microsoft.com/en-us/topic/description-of-microsoft-system-information-msinfo32-exe-tool-10d335d8-5834-90b4-8452-42c58e61f9fc )
@andrei-epure-sonarsource
At production environment we have Docker based installation.
My local information:
deleted
Oops sorry I gave the wrong link - we'd need the SQ System Info https://docs.sonarqube.org/latest/instance-administration/system-info/#header-1
@andrei-epure-sonarsource
Thanks. To check if something went wrong with the update, could you do the analysis with a local fresh SQ 8.9 install (with the out-of-the-box in-memory database for testing purposes)?
Hi @andrei-epure-sonarsource
I've updated Server to 9.0.1 version, dropped flex plugin manually and restarted server. Now it works
Shall I close the issue?
Thank you for your support
Thanks for letting us know.
This looks like an issue with SQ or its plugins that cannot be fixed in this repo so I'll close this.
Description
I've done upgrade SonarQube 8.4 -> 8.9 LTS.
Repro steps
If possible then please create a git repository with a repro sample or attach a zip to the issue.
Expected behavior
Works without errors
Actual behavior
Getting error.
java.lang.IllegalStateException: The field 'threshold' does not exist or is not annotated with @RuleProperty in the class org.sonar.flex.checks.ClassNameCheck
Known workarounds
No
Related information
Did some research and found out https://github.com/SonarSource/sonar-flex/blob/52600cc15ea25bcf82ef57083c40f29a1b4ab0a8/flex-checks/src/main/java/org/sonar/flex/checks/ClassNameCheck.java. For some reason scanner use Flex plugin. At SonarQube Flex Language settings page we had suffix 'as' instead of '.as'. Changed to '.as' - didn't help.