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

[exporter/kafkaexporter] panic runtime error when not using SASL config #24797

Closed
rcrowe opened this issue Aug 2, 2023 · 2 comments · Fixed by #24798
Closed

[exporter/kafkaexporter] panic runtime error when not using SASL config #24797

rcrowe opened this issue Aug 2, 2023 · 2 comments · Fixed by #24798
Labels
bug Something isn't working exporter/kafka

Comments

@rcrowe
Copy link
Contributor

rcrowe commented Aug 2, 2023

Component(s)

exporter/kafka

What happened?

Description

Kafka exporter will attempt to validate SASL config even when it's not present; likely introduced as part of #21075

validateSASLConfig is being called with nil generating a runtime panic.

Steps to Reproduce

Configure Kafka exporter with TLS auth & start the collector...

exporters:
  kafka:
    protocol_version: 2.6.0
    brokers:
      - <snip>
    auth:
      tls:
        ca_file: /kafka-client-certificate/ca.crt
        cert_file: /kafka-client-certificate/tls.crt
        key_file: /kafka-client-certificate/tls.key
        reload_interval: 1h

Expected Result

When SASL auth configuration is not defined, validation is skipped & no error is generated.

Actual Result

Starting the collector will raise...

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x327b638]

goroutine 1 [running]:
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter.validateSASLConfig(0xc000e840c8?)
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/config.go:107 +0x18
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter.(*Config).Validate(0xc0003dd400)
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/config.go:103 +0x6b

Collector version

v0.82.0

Environment information

k8s v1.27.2

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

PR addressing the issue: #24798

@rcrowe rcrowe added bug Something isn't working needs triage New item requiring triage labels Aug 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@arad-g
Copy link

arad-g commented Aug 4, 2023

We had the same issue. Downgraded to v0.81.0 as a temporary solution.

TylerHelmuth pushed a commit that referenced this issue Aug 4, 2023
…esent (#24798)

**Description:** 

Ignore validating SASL auth config when it's not present.

Fixes: #24797

---------

Signed-off-by: Rob Crowe <[email protected]>
Co-authored-by: Anthony Mirabella <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/kafka
Projects
None yet
3 participants