-
Notifications
You must be signed in to change notification settings - Fork 5k
[8.19](backport #44131) [libbeat/logging] fix a breaking bug #44685
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
* fix a breaking bug * remove panic * fix log config * changelog * fix test * no changelog * fix OverwriteSettings (cherry picked from commit 3604ffa) # Conflicts: # libbeat/cmd/instance/beat.go
|
Cherry-pick of 3604ffa has failed: 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 |
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
#44684 is required before moving on with that one. |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
Closing this, will get fixed other backports |
|
@khushijain21 just to be sure to understand, why did you close this PR? |
Proposed commit message
I think this is a breaking change that we need to address ASAP, hence tagging this PR as
impact:critical.This PR moves logging initialisation before we move forward with rest of the flow.
Issues:
We initialise logger at
beats/libbeat/cmd/instance/beat.go
Lines 1037 to 1043 in 4c1bf91
But, we make use of logger in
promoteOutputQueueSettings, which called is before logger's initialisationbeats/libbeat/cmd/instance/beat.go
Lines 1018 to 1020 in 4c1bf91
beats/libbeat/cmd/instance/beat.go
Line 1772 in 4c1bf91
Logger doesn't exist at this point and it leads to a
nil dereferencepanic.We don't really see the panic message. The command just exits without any meaningful info. We log the panic here, we make use of
logp.NewLogger(...). It is a no-op logger if haven't configured the logger in the first place.How to reproduce
Just run filebeat in normal mode with following config and you'll see nothing. No log files created, no panics printed:
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
This is an automatic backport of pull request [libbeat/logging] fix a breaking bug #44131 done by Mergify.