Skip to content

SonarQube API Scan Configuration: Service key 1 is not optional #13959

@sNiXx

Description

@sNiXx

Bug description
"Service key 1" for the SonarQube API Scan Configuration is said to be optional. However, I tested adding a configuration without it and got an error that the component parameter is missing from the API call.

The following section should be handling this:

if config and config.service_key_1:
component = client.get_project(
config.service_key_1,
organization=organization,
branch=test.branch_tag,
)
else:
component = client.find_project(
test.engagement.product.name,
organization=organization,
branch=test.branch_tag,
)
# Get the resource from SonarQube

Steps to reproduce
Steps to reproduce the behavior:

  1. Go to Settings > Add API Scan Configuration in the product view
  2. Choose the SonarQube from the Tool Configuration dropdown and press Submit
  3. The following error appears:
    Unable to find the project None due to 400 - {"errors":[{"msg":"The \u0027component\u0027 parameter is missing"}]}
    

Expected behavior
If Service key 1 is not provided, the default should be applied (i.e. the product name in DefectDojo)

Deployment method

  • Docker Compose
  • Kubernetes
  • GoDojo

Environment information

  • Operating System: Ubuntu 24.04
  • Docker Compose version: 2.39.1
  • DefectDojo version: 2.51.2

Logs

[22/Dec/2025 17:36:12] INFO [dojo.product.views:1886] Unable to find the project None due to 400 - {"errors":[{"msg":"The \u0027component\u0027 parameter is missing"}]}

Screenshots
Image showing an error when adding a SonarQube Tool Configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp_wantedWe would welcome a community contribution on this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions