Skip to content
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

Skipping unparsable lines in docker input #12268

Merged
merged 1 commit into from
May 27, 2019

Conversation

marqc
Copy link
Contributor

@marqc marqc commented May 24, 2019

fix proposal for problem referenced in https://discuss.elastic.co/t/input-docker-stuck-when-bad-offset-is-saved-in-registry-file-bug/181828 where docker input is unparsable (either input itself is corrupted, or offset in registry is corrupted)

@marqc marqc requested a review from a team as a code owner May 24, 2019 11:03
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@kvch
Copy link
Contributor

kvch commented May 27, 2019

jenkins test this

@@ -276,6 +276,10 @@ func (h *Harvester) Run() error {
logp.Info("End of file reached: %s. Closing because close_eof is enabled.", h.state.Source)
case ErrInactive:
logp.Info("File is inactive: %s. Closing because close_inactive of %v reached.", h.state.Source, h.config.CloseInactive)
case reader.ErrLineUnparsable:
logp.Err("Skipping unparsable line in file: %v", h.state.Source)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think this log message should be Info, as we have already emitted an error message from DockerJSON with the error message. To me this is rather a notification telling the user that a line was skipped due to an error before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to info

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have changed the wrong line for the case default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this time, I changed what i was supposed to change ;)

@marqc marqc force-pushed the docker_input_skip_unparsable_lines branch from cbaafbf to eda4a25 Compare May 27, 2019 08:04
@marqc marqc force-pushed the docker_input_skip_unparsable_lines branch 2 times, most recently from 7789894 to 5c3ab65 Compare May 27, 2019 08:56
@exekias
Copy link
Contributor

exekias commented May 27, 2019

Thank you for opening, this is defensive code that should help when this problems arises. Could you add an entry in CHANGELOG.next.asciidoc?

@exekias
Copy link
Contributor

exekias commented May 27, 2019

would love to see some unit tests in docker_json_test.go

@marqc marqc force-pushed the docker_input_skip_unparsable_lines branch from 5c3ab65 to 281f5b9 Compare May 27, 2019 13:46
@marqc
Copy link
Contributor Author

marqc commented May 27, 2019

@exekias changelog entry added, unit tests for docker_json changed to cover error message verification

@exekias
Copy link
Contributor

exekias commented May 27, 2019

jenkins, test this please

@exekias exekias added bug needs_backport PR is waiting to be backported to other branches. labels May 27, 2019
@exekias exekias merged commit 3451d06 into elastic:master May 27, 2019
@exekias exekias added v7.2.0 and removed needs_backport PR is waiting to be backported to other branches. labels Jun 19, 2019
exekias pushed a commit to exekias/beats that referenced this pull request Jun 19, 2019
@adawalli
Copy link

Will this be backported to 6.x? Really hitting this with a bunch of our containers

exekias pushed a commit that referenced this pull request Jul 8, 2019
…12608)

* Skipping unparsable lines in docker input (#12268)

(cherry picked from commit 3451d06)
exekias pushed a commit to exekias/beats that referenced this pull request Jul 8, 2019
@exekias exekias added the v6.8.2 label Jul 8, 2019
@exekias
Copy link
Contributor

exekias commented Jul 8, 2019

I've opened a backport to 6.8 branch: #12813

exekias pushed a commit that referenced this pull request Jul 11, 2019
…12813)

* Skipping unparsable lines in docker input (#12268)

(cherry picked from commit 3451d06)
@detro
Copy link

detro commented Jul 16, 2019

Hello.
I have a question about this fix: why is it tagged with 7.2.0 but it seems like it will be out only in 7.2.1? Was this just a hickup or am I misunderstanding the meaning of the tag?

Regardless, thanks for this: looking forward to update Filebeat and get rid of this issue. We have had long running containers that logged nothing for the last 4 days because of the issue that this code fixes.

@detro
Copy link

detro commented Jul 22, 2019

Hello. Any update about the release of the 7.2.1 Docker image?
Alternatively, can I ask for a pointer (a doc?) so I can build and package a Docker image with Filebeat 7.2.1?

Thanks in advance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants