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

Filebeat's log harvester panics on configuration error #6800

Closed
adriansr opened this issue Apr 9, 2018 · 0 comments
Closed

Filebeat's log harvester panics on configuration error #6800

adriansr opened this issue Apr 9, 2018 · 0 comments

Comments

@adriansr
Copy link
Contributor

adriansr commented Apr 9, 2018

When a configuration error is found in the log harvester, it panics instead of printing an error message.

For example, adding the following configuration:

  encoding: foo

results in:

2018-04-09T12:31:05.135+0200	FATAL	[filebeat]	instance/beat.go:138	Failed due to panic.	{"panic": "runtime error: invalid memory address or nil pointer dereference", "stack": "github.com/elastic/beats/libbeat/cmd/instance.Run.func1.1\n\t/Users/adrian/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:139\nruntime.call32\n\t/usr/local/go/src/runtime/asm_amd64.s:509\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:491\nruntime.panicmem\n\t/usr/local/go/src/runtime/panic.go:63\nruntime.sigpanic\n\t/usr/local/go/src/runtime/signal_unix.go:367\ngithub.com/elastic/beats/filebeat/input/log.(*Input).createHarvester\n\t/Users/adrian/go/src/github.com/elastic/beats/filebeat/input/log/input.go:588\ngithub.com/elastic/beats/filebeat/input/log.NewInput\n\t/Users/adrian/go/src/github.com/elastic/beats/filebeat/input/log/input.go:97\ngithub.com/elastic/beats/filebeat/input.New\n\t/Users/adrian/go/src/github.com/elastic/beats/filebeat/input/input.go:75\ngithub.com/elastic/beats/filebeat/crawler.(*Crawler).startInput\n\t/Users/adrian/go/src/github.com/elastic/beats/filebeat/crawler/crawler.go:91\ngithub.com/elastic/beats/filebeat/crawler.(*Crawler).Start\n\t/Users/adrian/go/src/github.com/elastic/beats/filebeat/crawler/crawler.go:52\ngithub.com/elastic/beats/filebeat/beater.(*Filebeat).Run\n\t/Users/adrian/go/src/github.com/elastic/beats/filebeat/beater/filebeat.go:321\ngithub.com/elastic/beats/libbeat/cmd/instance.(*Beat).launch\n\t/Users/adrian/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:321\ngithub.com/elastic/beats/libbeat/cmd/instance.Run.func1\n\t/Users/adrian/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:146\ngithub.com/elastic/beats/libbeat/cmd/instance.Run\n\t/Users/adrian/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:147\ngithub.com/elastic/beats/libbeat/cmd.genRunCmd.func1\n\t/Users/adrian/go/src/github.com/elastic/beats/libbeat/cmd/run.go:19\ngithub.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).execute\n\t/Users/adrian/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:704\ngithub.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).ExecuteC\n\t/Users/adrian/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:785\ngithub.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).Execute\n\t/Users/adrian/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:738\nmain.main\n\t/Users/adrian/go/src/github.com/elastic/beats/filebeat/main.go:18\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:195"}

instead of:

2018-04-09T12:30:42.982+0200	INFO	instance/beat.go:321	filebeat stopped.
2018-04-09T12:30:42.982+0200	ERROR	instance/beat.go:681	Exiting: Error in initing input: unknown encoding('foo')
Exiting: Error in initing input: unknown encoding('foo')
@adriansr adriansr added bug Filebeat Filebeat labels Apr 9, 2018
adriansr added a commit to adriansr/beats that referenced this issue Apr 9, 2018
When the log harvester initialisation fails (i.e. due to wrong configuration),
it causes a panic instead of reporting the error.

Fixes elastic#6800
ruflin pushed a commit that referenced this issue Apr 9, 2018
When the log harvester initialisation fails (i.e. due to wrong configuration),
it causes a panic instead of reporting the error.

Fixes #6800
@adriansr adriansr added the needs_backport PR is waiting to be backported to other branches. label Apr 9, 2018
adriansr added a commit to adriansr/beats that referenced this issue Apr 9, 2018
When the log harvester initialisation fails (i.e. due to wrong configuration),
it causes a panic instead of reporting the error.

Fixes elastic#6800
tsg pushed a commit that referenced this issue Apr 9, 2018
When the log harvester initialisation fails (i.e. due to wrong configuration),
it causes a panic instead of reporting the error.

Fixes #6800
@tsg tsg added v6.2.4 and removed needs_backport PR is waiting to be backported to other branches. labels Apr 9, 2018
leweafan pushed a commit to leweafan/beats that referenced this issue Apr 28, 2023
When the log harvester initialisation fails (i.e. due to wrong configuration),
it causes a panic instead of reporting the error.

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

No branches or pull requests

2 participants