Skip to content

Ignore error Unable to validate API Key in agent info output#961

Merged
levan-m merged 1 commit intomainfrom
levan-m/ignore-test-api-key
Oct 3, 2025
Merged

Ignore error Unable to validate API Key in agent info output#961
levan-m merged 1 commit intomainfrom
levan-m/ignore-test-api-key

Conversation

@levan-m
Copy link
Contributor

@levan-m levan-m commented Oct 3, 2025

What does this PR do?

Motivation

Fixing CI failure appering in #959, #958, etc.

       Failures:
       
         1) Command "/etc/init.d/datadog-agent info | grep -v "API Key is invalid" | grep -v "not sure how to interpret line"" stdout is expected not to contain "ERROR"
            Failure/Error: its(:stdout) { should_not contain 'ERROR' }
              expected "====================\nCollector (v 5.32.9)\n====================\n\n  Status date: 2025-10-03 14:38:...bytes\n  Stats: 0 payloads, 0 stats buckets, 0 bytes\n  Services: 0 payloads, 0 services, 0 bytes\n" not to contain "ERROR"
              
            # /tmp/verifier/suites/serverspec_datadog/dd-agent_spec.rb:30:in `block (2 levels) in <top (required)>'
       
       Finished in 1.05 seconds (files took 0.26317 seconds to load)
       13 examples, 1 failure

Most likely root cause is API response error code change from 403 to 401 handled here(?). Elsewhere in test output we see these lines

# last successful run
       Running handlers:
       [2025-04-17T22:02:32+00:00] WARN: Could not determine whether chef run metrics were successfully submitted to Datadog. Error:
       Response Content-Type is not application/json but is text/html: <!DOCTYPE html>\..         <h2>403 - Forbidden!</h2>\n        <ul>\n                   <li id='live_status' class='hid....y>\n</html>
# failed run
       Running handlers:
       [2025-10-03T15:12:43+00:00] WARN: Could not determine whether chef run metrics were successfully submitted to Datadog. Error:
       Response Content-Type is not application/json but is text/plain: Invalid API Key
       [2025-10-03T15:12:43+00:00] WARN: Could not determine whether Chef event was successfully submitted to Datadog: . Error:
       Response Content-Type is not application/json but is text/plain: Invalid API Key
       [2025-10-03T15:12:43+00:00] WARN: Could not submit ["env:_default"] tags for dd-agent-gpgcheck-older-centos-77 to Datadog: ["401", {"errors"=>["Unauthorized"]}]

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Reviewer's Checklist

@levan-m levan-m requested a review from a team as a code owner October 3, 2025 19:58
@levan-m levan-m merged commit 2926b72 into main Oct 3, 2025
13 checks passed
@levan-m levan-m deleted the levan-m/ignore-test-api-key branch October 3, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants