-
Notifications
You must be signed in to change notification settings - Fork 72
Error during SonarQube Scanner execution ([sonar4bitbucket] Failed to parse diff: string matching regex \z' expected but
F' found)
#102
Comments
Experiencing the same issue: Plugin version v1.2.3, SonarQube server 6.7.4 on Jenkins, building an npm project (Angular/Typescript) |
We're also experiencing this issue on v1.2.3 |
We were seeing the same issue, and I think I got to the bottom of it. The BB Excluded Files feature changes the diff of excluded files in their
When I removed the Excluded Files configuration from our repo, the sonarqube plugin worked as expected. I would be surprised if BB would accept this as a bug on their end, so I think the sonar-bitbucket-plugin needs to update its parsing handling for this scenario. |
we got the same issue
but the "Exclude files from pull request diffs" is empty in repository settings. So the issue seems to be caused from different reason Maybe our case is:
|
@mrueegg any chance to get these fixed? |
@kaidjohnson I think I found a solution for your problem, check pull request #118 . I hope it also solves your problem @dnlowman |
@nfalco79 Were you able to find the solution to your issue? I'm facing a similar issue because of which my sonar analysis is failing. Is there a way I can skip diff --git on all .png files?
|
built using the #118 |
@nfalco79 Thanks Nikolas! |
#118 looks like it addresses known comments in BB diffs. Might not cover all use-cases, but seems to fix the Excluded Files and Binary file diff outputs. Thank you! |
Expected Behavior
Scanner execution should behave as normal.
Actual Behavior
It's throwing the following exception:
java.lang.RuntimeException: [sonar4bitbucket] Failed to parse diff: string matching regex
\z' expected butF' found at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.parseOrFail(IssuesOnChangedLinesFilter.scala:54) at ch.mibex.bitbucket.sonar.diff.IssuesOnChangedLinesFilter.filter(IssuesOnChangedLinesFilter.scala:16) at ch.mibex.bitbucket.sonar.review.ReviewCommentsHandler.processIssues(ReviewCommentsHandler.scala:96) at ch.mibex.bitbucket.sonar.review.ReviewCommentsHandler.updateComments(ReviewCommentsHandler.scala:33) at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.ch$mibex$bitbucket$sonar$review$SonarReviewPostJob$$handlePullRequest(SonarReviewPostJob.scala:45) at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$execute$1.apply(SonarReviewPostJob.scala:29) at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob$$anonfun$execute$1.apply(SonarReviewPostJob.scala:27) at scala.collection.immutable.List.foreach(List.scala:381) at ch.mibex.bitbucket.sonar.review.SonarReviewPostJob.execute(SonarReviewPostJob.scala:27) at org.sonar.scanner.postjob.PostJobWrapper.executeOn(PostJobWrapper.java:58) at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:66) at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55) at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:94) at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121) at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288) at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283) at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121) at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48) at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121) at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121) at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71) 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:171) at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128) at org.sonarsource.scanner.cli.Main.execute(Main.java:111) at org.sonarsource.scanner.cli.Main.execute(Main.java:75) at o
Plug-in version, SonarQube version, CI system, build type
We're using version v1.2.3 of the plugin, version 6.7.1 (build 35068) of SonarQube on Bitbucket Pipelines which is building a project with npm.
This issue is and could be related to this issue: #8 and I did try and follow some of steps which were identified there like ensuring line feeds are at the end of each file, I think the issue could lie with the value of the diff from the previous commit which is missing the LF at the end of the string.
The text was updated successfully, but these errors were encountered: