-
Notifications
You must be signed in to change notification settings - Fork 5k
[libbeat/logging] fix a breaking bug #44131
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.
To fixup this pull request, you need to add the backport labels for the needed
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
This looks like a side effect of #43356. We haven't backported it to any of our branches, so we're good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we need a test that catches this to track the regression. But it can be introduced in a follow up PR.
Since it was never released, I don't think we need a changelog entry.
Also it'd good a test to ensure beats/libbeat/cmd/instance/beat.go Lines 188 to 191 in 4c1bf91
|
Yeah, my biggest fear was if this change was baported to 8.x or 9.0. But, we're good. |
@AndersonQ it works now. We see a panic message in log file. |
|
@VihasMakwana , i think there is a catch here
|
I see. Fixed it. |
* 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
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 dereference
panic.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.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact