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

No HTML-Report found. Please check property sonar.dependencyCheck.htmlReportPath error in Sonarqube UI when using dependency-check plugin #1013

Open
Krishpluto opened this issue Oct 25, 2024 · 1 comment
Labels

Comments

@Krishpluto
Copy link

Krishpluto commented Oct 25, 2024

Describe the bug
In Gitlab, we are currently working on integrating our project with SonarQube. Our gitlab project has been set up and integrated with the Sonarqube community edition. However, when the dependency check is run from the yaml file, the Dependency check plugin does not display the report in Sonarqube. Instead, it shows the message "No HTML-Report found. Please check property sonar.dependencyCheck.htmlReportPath," despite the correct path being set up in our script files. We are seeking guidance on how to correctly set up the integration, in case it was done incorrectly, as we haven't found suitable setup examples. We would appreciate advice on how to proceed.

Current behavior
Error is showing in the place of dependency report "No HTML-Report found. Please check property sonar.dependencyCheck.htmlReportPath"

Expected behavior
Dependency report should display in the SonarQube

Screenshots
image

Versions (please complete the following information):

  • sonarqube - 10.6
  • dependency-check-sonar-plugin - 5.0.0

Additional context
Please find the Sonar related part in Gitlab yml file below:

sonarqube:
  # allow_failure: true
  variables:
    SONAR_USER_HOME:
      value: "${CI_PROJECT_DIR}/.sonar"
  rules:
    - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_COMMIT_REF_NAME

sonarqube-vulnerability-report-merge-requests:
  stage: test-report
  image:
    name: node:lts
  before_script:
    - npm install -g sonar-report
  script:
    - sonar-report
      --sonarurl $SONAR_HOST_URL
      --sonartoken $SONAR_TOKEN
      --project="Sonar Report"
      --application $SONAR_PROJECT_KEY
      --release $CI_COMMIT_SHA
      --pullrequest $CI_MERGE_REQUEST_ID
      --sonarcomponent $SONAR_PROJECT_KEY
      --allbugs
      --no-security-hotspot
      --output="sonar-report_sonar-report.html"
  artifacts:
    name: "sonar-report"
    paths:
      - sonar-report_sonar-report.html
    expire_in: 1 Day
    expose_as: "Vulnerability Report"
  allow_failure: true
  rules:
    - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_COMMIT_REF_NAME

sonar-projects.properties file:

sonar.projectKey=*****
sonar.projectName=*****
sonar.verbose=false
sonar.host.url=******
sonar.links.homepage=******
sonar.links.scm=*******
sonar.links.ci=******

sonar.dependencyCheck.htmlReportPath=sonar-report_sonar-report.html
sonar.dependencyCheck.jsonReportPath=sonar-report_sonar-report.json
sonar.dependencyCheck.severity.blocker=6.0
sonar.dependencyCheck.severity.critical=4.0
sonar.dependencyCheck.severity.major=2.0
sonar.dependencyCheck.severity.minor=0.0

sonar.dependencyCheck.securityHotspot=true

sonar.shellcheck.reportPath=shellcheck-report.json
sonar.python.version=3.10
sonar.python.coverage.reportPaths=coverage.xml

sonar.dockerfile.dockerfilePaths=Dockerfile

sonar.qualitygate.wait=true
sonar.qualitygate.timeout=300

@Krishpluto Krishpluto added the bug label Oct 25, 2024
@Reamer
Copy link
Member

Reamer commented Dec 5, 2024

The path is usually set incorrectly. Take a look at the debug log output of the SonarQube agent/plugin.

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