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

file output - panic when missing 'path' option #39096

Open
andrewkroh opened this issue Apr 19, 2024 · 1 comment
Open

file output - panic when missing 'path' option #39096

andrewkroh opened this issue Apr 19, 2024 · 1 comment
Labels
bug libbeat needs_team Indicates that the issue/PR needs a Team:* label

Comments

@andrewkroh
Copy link
Member

path is mandatory according to the docs. Beats should not panic when the value is missing. Instead they should emit a clear error message about the problematic configuration.

Version: b0690b5

output.file:
  filename: api-events.ndjson
{
  "@timestamp": "2024-04-19T19:42:33.273-0400",
  "ecs.version": "1.6.0",
  "error": {
    "message": "runtime error: invalid memory address or nil pointer dereference"
  },
  "log.level": "fatal",
  "log.logger": "filebeat",
  "log.origin": {
    "file.line": 212,
    "file.name": "instance/beat.go",
    "function": "github.com/elastic/beats/v7/libbeat/cmd/instance.Run.func1.1"
  },
  "message": "Failed due to panic.",
  "service.name": "filebeat",
  "stack": "github.com/elastic/beats/v7/libbeat/cmd/instance.Run.func1.1\n\tgithub.com/elastic/beats/v7/libbeat/cmd/instance/beat.go:213\nruntime.gopanic\n\truntime/panic.go:914\nruntime.panicmem\n\truntime/panic.go:261\nruntime.sigpanic\n\truntime/signal_unix.go:861\ngithub.com/elastic/beats/v7/libbeat/outputs/fileout.(*PathFormatString).Run\n\tgithub.com/elastic/beats/v7/libbeat/outputs/fileout/pathformatstring.go:47\ngithub.com/elastic/beats/v7/libbeat/outputs/fileout.(*fileOutput).init\n\tgithub.com/elastic/beats/v7/libbeat/outputs/fileout/file.go:74\ngithub.com/elastic/beats/v7/libbeat/outputs/fileout.makeFileout\n\tgithub.com/elastic/beats/v7/libbeat/outputs/fileout/file.go:65\ngithub.com/elastic/beats/v7/libbeat/outputs.Load\n\tgithub.com/elastic/beats/v7/libbeat/outputs/output_reg.go:109\ngithub.com/elastic/beats/v7/libbeat/cmd/instance.(*Beat).createOutput\n\tgithub.com/elastic/beats/v7/libbeat/cmd/instance/beat.go:1262\ngithub.com/elastic/beats/v7/libbeat/cmd/instance.(*Beat).createBeater.(*Beat).makeOutputFactory.func1\n\tgithub.com/elastic/beats/v7/libbeat/cmd/instance/beat.go:1157\ngithub.com/elastic/beats/v7/libbeat/publisher/pipeline.loadOutput\n\tgithub.com/elastic/beats/v7/libbeat/publisher/pipeline/module.go:139\ngithub.com/elastic/beats/v7/libbeat/publisher/pipeline.LoadWithSettings\n\tgithub.com/elastic/beats/v7/libbeat/publisher/pipeline/module.go:95\ngithub.com/elastic/beats/v7/libbeat/cmd/instance.(*Beat).createBeater\n\tgithub.com/elastic/beats/v7/libbeat/cmd/instance/beat.go:391\ngithub.com/elastic/beats/v7/libbeat/cmd/instance.(*Beat).launch\n\tgithub.com/elastic/beats/v7/libbeat/cmd/instance/beat.go:479\ngithub.com/elastic/beats/v7/libbeat/cmd/instance.Run.func1\n\tgithub.com/elastic/beats/v7/libbeat/cmd/instance/beat.go:221\ngithub.com/elastic/beats/v7/libbeat/cmd/instance.Run\n\tgithub.com/elastic/beats/v7/libbeat/cmd/instance/beat.go:222\ngithub.com/elastic/beats/v7/libbeat/cmd.genRunCmd.func1\n\tgithub.com/elastic/beats/v7/libbeat/cmd/run.go:36\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v1.7.0/command.go:944\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v1.7.0/command.go:1068\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v1.7.0/command.go:992\nmain.main\n\tgithub.com/elastic/beats/v7/x-pack/filebeat/main.go:22\nruntime.main\n\truntime/proc.go:267"
}
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 19, 2024
@botelastic
Copy link

botelastic bot commented Apr 19, 2024

This issue doesn't have a Team:<team> label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug libbeat needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

No branches or pull requests

1 participant