-
Notifications
You must be signed in to change notification settings - Fork 204
Fix error logging for provider failures #10217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request does not have a backport label. Could you fix it @straistaru? 🙏
|
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
If the provider already logged the reason internally, do we need to emit any more log lines? The line you're adding seems confusing as well. If we want to log something here, I'd drop the |
💛 Build succeeded, but was flaky
Failed CI StepsHistory
cc @straistaru |
|
@Mergifyio backport 8.18 8.19 9.0 9.1 9.2 |
✅ Backports have been created
|
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4)
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4)
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4)
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4)
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4)
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4) Co-authored-by: Stefan Traistaru <[email protected]>
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4) Co-authored-by: Stefan Traistaru <[email protected]>
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4) Co-authored-by: Stefan Traistaru <[email protected]>
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4) Co-authored-by: Stefan Traistaru <[email protected]>
* Fix error logging for provider failures * Add changelog fragment * Omit nil error detail from logs (cherry picked from commit 0a5c2a4) Co-authored-by: Stefan Traistaru <[email protected]>
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 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./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testDisruptive User Impact
None.
Related issues