Troubleshooting
This guide helps you resolve common issues with SonarQube connectors.
TOC
Connector Not ReadySymptomDiagnosis StepsScanner Job FailsSymptomDiagnosis StepsConfiguration Not FoundSymptomDiagnosis StepsQuality Gate FailureSymptomDiagnosis StepsPerformance IssuesSymptomDiagnosis StepsGetting HelpConnector Not Ready
Symptom
The SonarQube connector shows Ready: False status.
Diagnosis Steps
-
Check connector status:
Review the
status.conditionsfield for specific error messages. -
Common Causes and Solutions:
Invalid Token:
- Error: "Authentication failed" or "Token invalid"
- Solution: Verify the token in the secret is correct and not expired
- Generate a new token in SonarQube and update the secret
Connectivity Issues:
- Error: "Connection refused" or "Timeout"
- Solution: Verify the SonarQube instance is accessible from the cluster
- Check network policies, firewalls, and DNS resolution
Incorrect Address:
- Error: "404 Not Found" or "Invalid URL"
- Solution: Verify that
spec.addressincludes the correct protocol (https://) and path
Scanner Job Fails
Symptom
The sonar-scanner job fails or hangs during analysis.
Diagnosis Steps
-
Check job logs:
-
Common Causes and Solutions:
Missing sonar-project.properties:
- Error: "You must define the following mandatory properties"
- Solution: Ensure sonar-project.properties exists in your project root with required fields:
Proxy Configuration Not Loaded:
- Error: "Authentication required"
- Solution: Verify the scanner is using the connector configuration:
Insufficient Permissions:
- Error: "Insufficient privileges" or "403 Forbidden"
- Solution: Verify the token has "Execute Analysis" permission on the project
Configuration Not Found
Symptom
Pod fails to mount the sonar-project.properties configuration.
Diagnosis Steps
-
Verify CSI volume is properly configured: Check that the CSI volume is correctly configured in your Pod specification with the proper
connectorNameandconfiguration.namesattributes. -
Common Causes and Solutions:
Connector Not Ready:
- Solution: Wait for the connector to reach Ready state
- Configuration is available only when the connector is Ready
Incorrect Volume Configuration:
- Solution: Verify the CSI volume configuration includes:
connectorName: Name of your connectorconnectorNamespace: Namespace of your connectorconfiguration.names: "sonar-scanner"
Quality Gate Failure
Symptom
Analysis completes but quality gate status is not as expected.
Diagnosis Steps
-
Check SonarQube project dashboard for quality gate details
-
Common Causes and Solutions:
Quality Profile Mismatch:
- Solution: Verify the correct quality profile is assigned to your project
Coverage Threshold Not Met:
- Solution: Check if your project has test coverage data
- Ensure coverage reports are generated before analysis
New Code Period Configuration:
- Solution: Verify the new code period definition in SonarQube
Performance Issues
Symptom
Scanner takes too long or times out.
Diagnosis Steps
-
Common Causes and Solutions:
Large Codebase:
- Solution: Increase job timeout and resource limits:
Network Latency:
- Solution: Check network connectivity to SonarQube instance
- Consider using a SonarQube instance closer to your cluster
- Solution: Increase job timeout and resource limits:
Getting Help
If you continue to experience issues:
-
Check connector logs:
-
Review connector events:
-
Verify SonarQube instance health:
- Access the SonarQube web interface
- Check
/api/system/statusendpoint directly
-
Consult documentation: