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

"This request cannot be processed. Try again later." in Security Hotspots view after importing report when "sonar.dependencyCheck.securityHotspot" is enabled. #270

Closed
alixwar opened this issue Jul 27, 2020 · 10 comments
Labels

Comments

@alixwar
Copy link

alixwar commented Jul 27, 2020

Describe the bug
The Security Hotspots view "crashes" when the option "sonar.dependencyCheck.securityHotspot" is enabled after importing issues from an OWASP dependency check report. It works fine importing the issues if the option is disabled.

I first saw the issue here: #252 (comment) but we couldn't figure out where the problem was.
Since then the PR was merged and there was a new release (2.0.5) and I could reproduce the problem in production.
I created a support ticket at SonarSource for the problem and they say the following:

I did look at your screenshot as indeed it is a JS/TS error.

But if the problem does not happen when the dependency check plugin is not installed, this is a side effect of that 3rd party plugin and there is not much I can do for you about it.

Regards, Olivier

PS: Admittedly we could have the JS code more robust to plugins that do not implement all the latest features of SonarQube (like hotspots, precise issue location - I suspect this is more due to the latter), but this can't be considered a priority issue for us.

The screenshot from the debugger that I sent to SonarSource:
SUPPORT-19786

Versions (please complete the following information):

  • Dependency check plugin 2.0.5
  • SonarQube 8.3.1 Enterprise Edition
@alixwar alixwar added the bug label Jul 27, 2020
@alixwar alixwar changed the title "This request cannot be processed. Try again later." when using security hotspots "This request cannot be processed. Try again later." in Security Hotspots view after importing report when "sonar.dependencyCheck.securityHotspot" is enabled. Jul 27, 2020
@Reamer
Copy link
Member

Reamer commented Jul 27, 2020

Hi @alixwar,
as long as you can't provide a way to reproduce the problem, I can't help you. I'm sorry.

One last possibility:
If you disable the dependency-check hotspot feature and reimport your issues. Are all issue linked against a file?

@alixwar
Copy link
Author

alixwar commented Jul 27, 2020

Hi @alixwar,
as long as you can't provide a way to reproduce the problem, I can't help you. I'm sorry.

I understand. But anyway, I think it's good that the issue is reported so that other people can provide input.

One last possibility:
If you disable the dependency-check hotspot feature and reimport your issues. Are all issue linked against a file?

I can't play around with our production environment unfortunately so I would need to set up a sandbox. I'm not sure if/when I have time to look into this. But if/when I will post my results here.

@alixwar
Copy link
Author

alixwar commented Jul 29, 2020

Here is one more screenshot with the line of code failing:

issue-securityhotspot

@alixwar
Copy link
Author

alixwar commented Jul 29, 2020

@alixwar
Copy link
Author

alixwar commented Jul 29, 2020

issue-securityhotspot2
With debug info

@Reamer
Copy link
Member

Reamer commented Jul 29, 2020

Hi @alixwar,
Thank you for opening a bug report in the sonarqube community forum and for providing debug output. It seems that the TypeScript did not find any TextRange. This can happen when a security hotspot issue is linked to the project.

Do you have the following output in your sonar analysis?

No project configuration file, e.g. pom.xml, *.gradle, *.gradle.kts, package-lock.json found, therefore it isn't possible to correctly link dependencies with files.

@alixwar
Copy link
Author

alixwar commented Jul 30, 2020

Hi @Reamer, yes I can confirm that I see this:

2020-07-30T08:58:19.162+0200 [INFO] [org.sonarqube.gradle.SonarQubeTask] Using XML-Reportparser
2020-07-30T08:58:19.512+0200 [INFO] [org.sonarqube.gradle.SonarQubeTask] No project configuration file, e.g. pom.xml, *.gradle, *.gradle.kts, package-lock.json found, therefore it isn't possible to correctly link dependencies with files.

I'm now looking into how to configure sonar.sources to include build.gradle without breaking anything...
According to https://docs.gradle.org/current/userguide/organizing_gradle_projects.html the build.gradle files should not be in "src/main". But sonar.sources is set to "src/main". I have requested help from SonarSource through our support account. Let's see what they say.

@Reamer
Copy link
Member

Reamer commented Jul 30, 2020

HI @alixwar,
this line should solve your problem.

properties["sonar.sources"] += "build.gradle"

@alixwar
Copy link
Author

alixwar commented Jul 30, 2020

HI @alixwar,
this line should solve your problem.

properties["sonar.sources"] += "build.gradle"

Thanks! I have a multi-module project but I will try this

@alixwar
Copy link
Author

alixwar commented Jul 30, 2020

@Reamer This didn't work for a multi-module project but this configuration solved it for me:


subprojects {
    sonarqube {
        properties {
              property "sonar.sources", "src/main,build.gradle"
...

I can confirm that it works as expected for me now.

@alixwar alixwar closed this as completed Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants