zap-sonar-plugin icon indicating copy to clipboard operation
zap-sonar-plugin copied to clipboard

Java error when adding report HTML Azure Devops CI

Open kocercan opened this issue 4 years ago • 2 comments

CI Task

  - task: SonarQubePrepare@4
    inputs:
      SonarQube: 'SonarqubeDevTest-ErcanTest'
      scannerMode: 'MSBuild'
      projectKey: 'ErcanTest'
      projectName: 'ErcanTest'
      extraProperties: |
        sonar.zaproxy.reportPath=$(System.DefaultWorkingDirectory)/owaspzap/test-results.xml
        sonar.zaproxy.htmlReportPath=$(System.DefaultWorkingDirectory)/owaspzap/report.html

Error: ##[error]ERROR: Error during SonarScanner execution java.lang.UnsupportedOperationException: Can not add the same measure twice on [key=ErcanTest]: DefaultMeasure[component=[key=ErcanTest],metric=Metric[uuid=<null>,key=html_report,description=Report HTML,type=DATA,direction=0,domain=OWASP-ZAP,name=ZAP Report,qualitative=false,userManaged=false,enabled=true,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=true,decimalScale=<null>],value=<html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85) at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59) at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59) 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:393) at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:389) at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:386) at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358) 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:144) 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) ERROR: ##[error]The SonarScanner did not complete successfully The SonarScanner did not complete successfully ##[error]11:40:02.815 Post-processing failed. Exit code: 1 11:40:02.815 Post-processing failed. Exit code: 1 ##[error]The process '/usr/bin/dotnet' failed with exit code 1

kocercan avatar Feb 05 '21 12:02 kocercan

We had exactly same error and it only happens on the html report. The upload of zaproxy xml report doesn't have this error.

Also it only happens on the Scanner for .NET as the other Java scanner can upload both xml and html report without any problem.

victorwon avatar Aug 24 '21 23:08 victorwon

We also have the same problem. The HTML load in the .NET scanner fails. On the other hand, the XML report loads correctly. It works with Maven in both XML and HTML. Is there any solution to this?

Thanks in advance.

ioritz1993 avatar Mar 28 '23 13:03 ioritz1993