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

Core dump when tls is off for output plugins which have TLS optional #1840

Closed
phiremande opened this issue Dec 24, 2019 · 1 comment
Closed

Comments

@phiremande
Copy link
Contributor

phiremande commented Dec 24, 2019

Bug Report

Describe the bug
When tls is set to Off and

  1. tls.crt_file and/or tls.key_file is set to a file which is not present.
  2. Or if the /etc/ssl/certs doesn't contain cert/key
    In these cases the fluent-bit crashes.
    An example plugin where TLS is optional is the output plugin kafka-rest.

To Reproduce
[OUTPUT]
Name kafka-rest
Match my_input
Host localhost
Port 8082
Topic my_kafka_test
Message_Key my_key

tls         Off
tls.verify  Off
tls.ca_file     /tmp/fluent-bit/certificate.pem
tls.crt_file    /tmp/fluent-bit/certificate.pem
tls.key_file    /tmp/fluent-bit/key.pem
[2019/12/25 01:10:30] [error] [TLS] Invalid Key file: /tmp/fluent-bit/key.pem
[2019/12/25 01:10:30] [error] [output kafka-rest.0] error initializing TLS context
[2019/12/25 01:10:30] [ info] [input] pausing tcp.0
[2019/12/25 01:10:30] [ info] [input] pausing tail.1
[2019/12/25 01:10:30] [ warn] [input] cannot disable event for tail.1
[2019/12/25 01:10:30] [ warn] [input] cannot disable event for tail.1
[2019/12/25 01:10:30] [ warn] [input] cannot disable event for tail.1
free(): invalid size
Aborted (core dumped)

  • Steps to reproduce the problem:
    Use a configuration as provided above and run fluent-bit. Else remove certs from /etc/ssl/certs and remove the tls.crt_file and tls.key_file entries from the above configuration.

Expected behavior
When tls is "Off" irrespective of whether the key/cert is present or not fluent-bit should run. key/cert are not necessary when tls is turned off.

Your Environment

  • Version used: latest from master
  • Configuration:
  • Environment name and version (e.g. Kubernetes? What version?):
  • Server type and version:
  • Operating System and version:
    Ubuntu 18.04
  • Filters and plugins:
    kafka-rest output plugin.

Additional context
Trying to send logs to kafka rest proxy with and without tls.

phiremande added a commit to phiremande/fluent-bit that referenced this issue Dec 24, 2019
phiremande added a commit to phiremande/fluent-bit that referenced this issue Dec 24, 2019
phiremande added a commit to phiremande/fluent-bit that referenced this issue Dec 24, 2019
Signed-off-by: Pradeep Hiremande <16595434+phiremande@users.noreply.github.com>
@phiremande phiremande changed the title segmentation fault when tls is off for output plugins which have TLS optional Core dump when tls is off for output plugins which have TLS optional Dec 27, 2019
phiremande added a commit to phiremande/fluent-bit that referenced this issue Dec 30, 2019
phiremande added a commit to phiremande/fluent-bit that referenced this issue Dec 30, 2019
Signed-off-by: Pradeep Hiremande <16595434+phiremande@users.noreply.github.com>
edsiper pushed a commit that referenced this issue Jan 13, 2020
Signed-off-by: Pradeep Hiremande <16595434+phiremande@users.noreply.github.com>
edsiper pushed a commit that referenced this issue Jan 13, 2020
Signed-off-by: Pradeep Hiremande <16595434+phiremande@users.noreply.github.com>
@edsiper
Copy link
Member

edsiper commented Jan 13, 2020

Fixed with #1841

thanks!

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