Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Oct 7, 2025

What does this PR do?

Avoid logging a nil error for provider exits.

Why is it important?

Some providers intentionally stop and return a nil error; they already log the exit reason internally. The previous log formatted a nil error into "%!s()", which can be confusing (e.g. provider "env" failed to run (will retry in 30s): %!s()). This change removes the incorrect formatting and only includes the error text when non-nil.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Disruptive User Impact

None.

Related issues

* Fix error logging for provider failures

* Add changelog fragment

* Omit nil error detail from logs

(cherry picked from commit 0a5c2a4)
@mergify mergify bot requested a review from a team as a code owner October 7, 2025 14:47
@mergify mergify bot added the backport label Oct 7, 2025
@mergify mergify bot requested review from blakerouse and swiatekm and removed request for a team October 7, 2025 14:47
@mergify mergify bot mentioned this pull request Oct 7, 2025
4 tasks
@github-actions github-actions bot added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Oct 7, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

cc @straistaru

@straistaru straistaru merged commit 5d28ead into 9.2 Oct 8, 2025
23 checks passed
@straistaru straistaru deleted the mergify/bp/9.2/pr-10217 branch October 8, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants