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

x-pack/filebeat/input/http_endpoint: config.URL can be empty resulting in panic #36772

Closed
efd6 opened this issue Oct 5, 2023 · 3 comments · Fixed by #36816
Closed

x-pack/filebeat/input/http_endpoint: config.URL can be empty resulting in panic #36772

efd6 opened this issue Oct 5, 2023 · 3 comments · Fixed by #36816
Assignees

Comments

@efd6
Copy link
Contributor

efd6 commented Oct 5, 2023

We have seen an integration using the http_endpoint input that fails with a panic due to a misconfiguration.

Input 'http_endpoint' failed with: input panic with: http: invalid pattern
goroutine 197 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x65
github.com/elastic/beats/v7/filebeat/input/v2/input-stateless.configuredInput.Run.func1()
	github.com/elastic/beats/v7/filebeat/input/v2/input-stateless/stateless.go:81 +0x7f
panic({0x55fbecb7bfc0, 0x55fbed39ef80})
	runtime/panic.go:884 +0x212
net/http.(*ServeMux).Handle(0xc000bb8780, {0x0, 0x0}, {0x55fbed3a4680?, 0xc00076de60})
	net/http/server.go:2497 +0x25f
github.com/elastic/beats/v7/x-pack/filebeat/input/http_endpoint.(*pool).serve(_, {0xc000bba830, {0xc000253780, 0x3f}, {{0x55fbebe57b10, 0x8}, {0x55fbebe57b10, 0x8}, {0x55fbebe4fba1, 0x5}, ...}, ...}, ...)
	github.com/elastic/beats/v7/x-pack/filebeat/input/http_endpoint/input.go:140 +0x63f
github.com/elastic/beats/v7/x-pack/filebeat/input/http_endpoint.(*httpEndpoint).Run(_, {0xc000bba830, {0xc000253780, 0x3f}, {{0x55fbebe57b10, 0x8}, {0x55fbebe57b10, 0x8}, {0x55fbebe4fba1, 0x5}, ...}, ...}, ...)
	github.com/elastic/beats/v7/x-pack/filebeat/input/http_endpoint/input.go:88 +0x6c
github.com/elastic/beats/v7/filebeat/input/v2/input-stateless.configuredInput.Run({{_, _}}, {0xc000bba830, {0xc000253780, 0x3f}, {{0x55fbebe57b10, 0x8}, {0x55fbebe57b10, 0x8}, {0x55fbebe4fba1, ...}, ...}, ...}, ...)
	github.com/elastic/beats/v7/filebeat/input/v2/input-stateless/stateless.go:97 +0x24b
github.com/elastic/beats/v7/filebeat/input/v2/compat.(*runner).Start.func1()
	github.com/elastic/beats/v7/filebeat/input/v2/compat/compat.go:114 +0x215
created by github.com/elastic/beats/v7/filebeat/input/v2/compat.(*runner).Start
	github.com/elastic/beats/v7/filebeat/input/v2/compat/compat.go:111 +0xd8

This happens when the url config option is empty. The default value set for this is "/", however, in this case that appears not to have been set. The validation code should check that the config is correct in this field to provide a more user-friendly error in the logs.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@bhapas
Copy link
Contributor

bhapas commented Oct 13, 2023

@efd6 Should this be backported to 8.11 ?

@efd6
Copy link
Contributor Author

efd6 commented Oct 13, 2023

Yeah, I think so.

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

Successfully merging a pull request may close this issue.

3 participants