Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 1, 2025

What does this PR do?

Updates the run subcommand to always log any errors to the logger.

Why is it important?

There where still some cases where the Elastic Agent can fail to run but the reason is not written to the log.

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


This is an automatic backport of pull request #10158 done by [Mergify](https://mergify.com).

* Update run command to have a critical section to ensure errors are always logged.

* Add changelog.

* Cleanup from code review.

(cherry picked from commit 18beeba)

# Conflicts:
#	internal/pkg/agent/cmd/run.go
@mergify mergify bot requested a review from a team as a code owner October 1, 2025 18:06
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Oct 1, 2025
@mergify mergify bot requested review from kaanyalti and swiatekm and removed request for a team October 1, 2025 18:06
Copy link
Contributor Author

mergify bot commented Oct 1, 2025

Cherry-pick of 18beeba has failed:

On branch mergify/bp/8.19/pr-10158
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit 18beeba11.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1758827841-Improve-logging-to-catch-early-errors-on-startup.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/agent/cmd/run.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Oct 1, 2025
@mergify mergify bot added the backport label Oct 1, 2025
@github-actions github-actions bot added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Oct 1, 2025
@elasticmachine
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request 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.

2 participants