Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonar 5.2 Compatibility: Rule Finder does not fetching rule parameter correctly #16

Closed
adonirammedeiros opened this issue Dec 2, 2015 · 15 comments
Assignees
Milestone

Comments

@adonirammedeiros
Copy link

Sonar-runner is throwing the following exception:
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.NullPointerException
at org.sonar.plugins.delphi.metrics.ComplexityMetrics.(ComplexityMetrics.java:141)
at org.sonar.plugins.delphi.DelphiSensor.analyse(DelphiSensor.java:111)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)

Debugging the error I find out that the rule finder is fetching empty params
sonar-remote-debugger.

@fabriciocolombo
Copy link
Owner

What sonar version are you using?
Could you verify the parameter name on the rules page?
It should be like the image below.

methods should not be too complex

@adonirammedeiros
Copy link
Author

Sonar 5.2.
The parameter is typed as you show.
I build the Source 0.3.3 as is with Java 8.
On postgres the value is right.

@fabriciocolombo
Copy link
Owner

I will try reproduce the error.

@fabriciocolombo
Copy link
Owner

Indeed, i got the same error with sonarqube 5.2

@adonirammedeiros
Copy link
Author

Which version can I use to work?

@fabriciocolombo
Copy link
Owner

You can use version 5.1.2 for now.
I will try fix this week.

@fabriciocolombo fabriciocolombo added this to the 0.3.3 milestone Dec 12, 2015
@adonirammedeiros
Copy link
Author

Ok.
Thanks

@fabriciocolombo fabriciocolombo changed the title Rule Finder does not fetching rule parameter correctly Sonar 5.2 Compatibility: Rule Finder does not fetching rule parameter correctly Dec 21, 2015
@Aarklendoia
Copy link

A link to download the vesrion 5.1.2 of Sonar ? The offical website have only the 4.5.6 LTS or 5.2...
I found it : https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.1.2.zip

@fabriciocolombo
Copy link
Owner

http://www.sonarqube.org/downloads then Show all versions

@fabriciocolombo
Copy link
Owner

This snapshot can be used to Sonar 5.2 until the final version is released.

@Aarklendoia
Copy link

It's besser but I have some files causing crash of Sonar. I joined an example of file causing the problem.

09:00:39.681 DEBUG - >> PARSING E:\jenkins\jobs\Grant\workspace\Composants\Chevrons\ChevronExt.pas
E:\jenkins\jobs\Grant\workspace\Composants\Chevrons\ChevronExt.pas line 100:7 missing END at '.'
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 4.453s
Final Memory: 31M/295M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: net.sourceforge.pmd.ast.ParseException: Error while parsing E:\jenkins\jobs\Grant\workspace\Composants\Chevro
ns\ChevronExt.pas
at org.sonar.plugins.delphi.DelphiSensor.analyseSourceFile(DelphiSensor.java:262)
at org.sonar.plugins.delphi.DelphiSensor.parseSourceFile(DelphiSensor.java:238)
at org.sonar.plugins.delphi.DelphiSensor.parseFiles(DelphiSensor.java:197)
at org.sonar.plugins.delphi.DelphiSensor.analyse(DelphiSensor.java:108)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more

Chevron.zip

@fabriciocolombo
Copy link
Owner

I updated the snapshot. Try again, please.
You will still get the parser error, but this will not stop the analysis.
The unit with problem is ChevronExt.pas, and you send me Chevron.pas. Is it right?
Chevron unit had not problem during parse. If you still got parser error, create a dedicated issue please and attach the source code to simulate the error.

Regards

@Aarklendoia
Copy link

Sorry, I send the wrong file !
ChevronExt.zip

I test the last snapshot and I have another crash :

12:50:37.073 DEBUG - >> PROCESSING E:\jenkins\jobs\Grant\workspace\EPERMIT.XE8\EPERMITCP00Tiles\sources\EPFClients.pas
12:50:37.074 DEBUG - Metric lines is an internal metric computed by SonarQube. Provided value is ignored.
12:50:37.075 DEBUG - >> PROCESSING E:\jenkins\jobs\Grant\workspace\EPERMIT.XE8\EPERMITCP00Tiles\sources\EPFMAIN00.pas
12:50:37.077 DEBUG - Metric lines is an internal metric computed by SonarQube. Provided value is ignored.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 19.762s
Final Memory: 42M/538M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalArgumentException: 1529 is not a valid line for pointer. File [moduleKey=GRANT, relative=wor
kspace/EPERMIT.XE8/EPERMITCP00Tiles/sources/EPFMAIN00.pas, basedir=E:\jenkins\jobs\Grant] has 259 line(s)
at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:214)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:208)
at org.sonar.api.batch.fs.internal.DefaultInputFile.selectLine(DefaultInputFile.java:243)
at org.sonar.batch.issue.DeprecatedIssueBuilderWrapper.line(DeprecatedIssueBuilderWrapper.java:59)
at org.sonar.plugins.delphi.metrics.ComplexityMetrics.addIssue(ComplexityMetrics.java:281)
at org.sonar.plugins.delphi.metrics.ComplexityMetrics.processFunction(ComplexityMetrics.java:191)
at org.sonar.plugins.delphi.metrics.ComplexityMetrics.analyse(ComplexityMetrics.java:144)
at org.sonar.plugins.delphi.DelphiSensor.processFiles(DelphiSensor.java:132)
at org.sonar.plugins.delphi.DelphiSensor.analyse(DelphiSensor.java:113)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more

@fabriciocolombo
Copy link
Owner

This error is new.
Can you send me the EPFMAIN00.pas unit for investigation?

@Aarklendoia
Copy link

Here, the file for investigation :
EPFMAIN00.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants