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

Stack traces are printed when some configuration values have an incorrect type #18378

Closed
jsoriano opened this issue May 8, 2020 · 4 comments
Closed
Labels
bug Filebeat Filebeat Stalled Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@jsoriano
Copy link
Member

jsoriano commented May 8, 2020

This happens at least with filebeat, when a module configuration contains settings of an unexpected type, a full stack trace is printed instead of just the error message. It should print only a error message indicating the problem with the configuration.

For confirmed bugs, please report:

  • Version: 7.x (at least)
  • Steps to Reproduce: For example in the following configuration, the ssl config should be passed as a yaml-formatted string, not as an object:
filebeat.modules:
  - module: misp
    threat:
      enabled: true
      var.ssl.verification_mode: "none"

output.console.pretty: true

When starting filebeat with this config, it exits with a trace like the following one:

Exiting: Failed to start crawler: starting input failed: Error while initializing input: (assert) value of type 'string' not convertible into unsupported go type 'tlscommon.Config' accessing 'ssl'
Trace:goroutine 1 [running]:
runtime/debug.Stack(0x39d0d97, 0xb, 0xc000b3de30)
	/home/jaime/go/src/runtime/debug/stack.go:24 +0x9d
github.com/elastic/go-ucfg.raiseCritical(0x3ee9740, 0xc0000c9110, 0xc00084ca80, 0x6b, 0x52, 0xc0001742c0)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/error.go:161 +0x66
github.com/elastic/go-ucfg.raiseToTypeNotSupported(0xc0009de870, 0x3fa4a40, 0xc0000a3040, 0x3fc3660, 0x3851380, 0x341d340, 0x0)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/error.go:294 +0x232
github.com/elastic/go-ucfg.doReifyPrimitive(0xc0009de870, 0x0, 0x0, 0x0, 0x0, 0x3fa4a40, 0xc0000a3040, 0x3fc3660, 0x3851380, 0x14940b8, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:763 +0x8a5
github.com/elastic/go-ucfg.reifyPrimitive(0xc0009de870, 0x0, 0x0, 0x0, 0x0, 0x3fa4a40, 0xc0000a3040, 0x3fc3660, 0x358a920, 0x3fc3660, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:665 +0x61d
github.com/elastic/go-ucfg.reifyValue(0xc0009de870, 0x0, 0x0, 0x0, 0x0, 0x3fc3660, 0x358a920, 0x3fa4a40, 0xc0000a3040, 0xc000a2c070, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:383 +0x990
github.com/elastic/go-ucfg.reifyMergeValue(0xc0009de870, 0x0, 0x0, 0x0, 0x0, 0x358a920, 0xc0009de978, 0x196, 0x3fa4a40, 0xc0000a3040, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:433 +0xfe6
github.com/elastic/go-ucfg.reifyGetField(0xc000677aa0, 0xc0009de870, 0x0, 0x0, 0x0, 0x0, 0x3249d50, 0x3, 0x358a920, 0xc0009de978, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:341 +0x2f3
github.com/elastic/go-ucfg.reifyStruct(0xc0009de870, 0x388bc60, 0xc0009de7e0, 0x199, 0xc000677aa0, 0x0, 0x0)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:285 +0x93c
github.com/elastic/go-ucfg.reifyInto(0xc0009de870, 0x352c940, 0xc0009de7e0, 0x16, 0xc000677aa0, 0x90, 0x388bc60)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:172 +0x40c
github.com/elastic/go-ucfg.(*Config).Unpack(0xc000677aa0, 0x352c940, 0xc0009de7e0, 0xc0004a2240, 0x4, 0x4, 0xc0009de750, 0x1551c4a)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/elastic/go-ucfg/reify.go:155 +0x103
github.com/elastic/beats/v7/libbeat/common.(*Config).Unpack(...)
	/home/jaime/gocode/src/github.com/elastic/beats/libbeat/common/config.go:186
github.com/elastic/beats/v7/x-pack/filebeat/input/httpjson.NewInput(0xc000677aa0, 0x3f0df00, 0xc0009d3ec0, 0xc00059d900, 0x9, 0x9, 0xc00069e180, 0xc0001b5920, 0x0, 0x0, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/x-pack/filebeat/input/httpjson/input.go:70 +0xe5
github.com/elastic/beats/v7/filebeat/input.New(0xc000677aa0, 0x3f0df00, 0xc0009d3ec0, 0xc0001b5920, 0xc00059d900, 0x9, 0x9, 0x0, 0xc000677aa0, 0xc0009dac40, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/filebeat/input/input.go:92 +0x2e9
github.com/elastic/beats/v7/filebeat/input.(*RunnerFactory).Create(0xc0006826e0, 0x3f0f200, 0xc0009d3ea0, 0xc000677aa0, 0x0, 0x5, 0xc0005f4100, 0x7, 0xc0005f4100)
	/home/jaime/gocode/src/github.com/elastic/beats/filebeat/input/runnerfactory.go:52 +0xcf
github.com/elastic/beats/v7/filebeat/channel.RunnerFactoryWithCommonInputSettings.func1(0x3f0dfc0, 0xc0006826e0, 0x3f0f240, 0xc0006826c0, 0xc000677aa0, 0x0, 0xc00005dfc8, 0x39c4a07, 0x4, 0x0)
	/home/jaime/gocode/src/github.com/elastic/beats/filebeat/channel/runner.go:103 +0x132
github.com/elastic/beats/v7/filebeat/channel.(*onCreateFactory).Create(0xc000682700, 0x3f0f240, 0xc0006826c0, 0xc000677aa0, 0x0, 0x0, 0x0, 0x0, 0x47)
	/home/jaime/gocode/src/github.com/elastic/beats/filebeat/channel/runner.go:71 +0x6a
github.com/elastic/beats/v7/filebeat/beater.(*crawler).startInput(0xc0001d2400, 0x3f0f240, 0xc0006826c0, 0xc000677aa0, 0xc000b3f0c0, 0x1)
	/home/jaime/gocode/src/github.com/elastic/beats/filebeat/beater/crawler.go:131 +0x1e5
github.com/elastic/beats/v7/filebeat/beater.(*crawler).Start(0xc0001d2400, 0x3f0f240, 0xc0006826c0, 0x0, 0x0, 0x1, 0x1)
	/home/jaime/gocode/src/github.com/elastic/beats/filebeat/beater/crawler.go:75 +0x13f
github.com/elastic/beats/v7/filebeat/beater.(*Filebeat).Run(0xc000686a20, 0xc00015f8c0, 0x0, 0x0)
	/home/jaime/gocode/src/github.com/elastic/beats/filebeat/beater/filebeat.go:292 +0xc24
github.com/elastic/beats/v7/libbeat/cmd/instance.(*Beat).launch(0xc00015f8c0, 0x39cbb06, 0x8, 0x39cbb06, 0x8, 0x0, 0x0, 0x1, 0x0, 0x0, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:462 +0x700
github.com/elastic/beats/v7/libbeat/cmd/instance.Run.func1(0x39cbb06, 0x8, 0x39cbb06, 0x8, 0x0, 0x0, 0xc000b3fc10, 0x3af0970, 0x0, 0x0)
	/home/jaime/gocode/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:199 +0x56b
github.com/elastic/beats/v7/libbeat/cmd/instance.Run(0x39cbb06, 0x8, 0x39cbb06, 0x8, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, ...)
	/home/jaime/gocode/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:200 +0x148
github.com/elastic/beats/v7/libbeat/cmd.genRunCmd.func1(0xc0002a2280, 0xc000568d00, 0x0, 0x4)
	/home/jaime/gocode/src/github.com/elastic/beats/libbeat/cmd/run.go:36 +0x9d
github.com/spf13/cobra.(*Command).execute(0xc0002a2280, 0xc000568c80, 0x4, 0x4, 0xc0002a2280, 0xc000568c80)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:766 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0xc00074c580, 0x0, 0xa4380, 0xc0000be058)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
	/home/jaime/gocode/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:800
main.main()
	/home/jaime/gocode/src/github.com/elastic/beats/x-pack/filebeat/main.go:22 +0x2f

There is a similar issue with export subcommands #17769.

@jsoriano jsoriano added bug Filebeat Filebeat [zube]: Inbox Team:Services (Deprecated) Label for the former Integrations-Services team labels May 8, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic
Copy link

botelastic bot commented Apr 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the Stalled label Apr 11, 2021
@jsoriano jsoriano removed the Stalled label Apr 12, 2021
@jlind23 jlind23 added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team and removed Team:Services (Deprecated) Label for the former Integrations-Services team labels Mar 31, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic
Copy link

botelastic bot commented Mar 31, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Mar 31, 2023
@botelastic botelastic bot closed this as completed Sep 27, 2023
@zube zube bot removed the [zube]: Done label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Filebeat Filebeat Stalled Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

No branches or pull requests

4 participants