Closed samg-monster closed 2 years ago
Hi @samg-monster, thanks for opening this issue! I'm taking a look into this and will follow up here.
The fix for this has been merged (#12437) and will be included in a future agent release. Thanks for reporting!
Output of the info page
Additional environment details (Operating System, Cloud provider, etc): Docker agent running on MacOS
Steps to reproduce the issue: This issue can be reproduced using the Datadog Sonarqube integration as an example.
The result should be an HTTP 200 status code to indicate that the authentication was successful. Note that the server expects an empty string for the password value and will fail to authenticate otherwise.
DD_LOG_LEVEL=debug
set and check the agent logs in /var/log/datadog/agent.log. You will see HTTP 401 errors as the agent cannot authenticate to the Sonarqube server. Example:Describe the results you received: The agent retrieves no metrics from the Sonarqube server as it cannot authenticate.
Describe the results you expected: The agent should successfully authenticate and retrieve metrics.
Additional information you deem important (e.g. issue happens only occasionally):
The issue is caused by this line of code: https://github.com/DataDog/integrations-core/blob/981926c042d380b6811df07cca2cb2bc56967976/datadog_checks_base/datadog_checks/base/utils/http.py#L630
If an empty string is provided as the password this conditional evaluates to false and prevents the authentication from progressing further. The solution is to change the line to