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

kafkareceiver panic #31926

Closed
povilasv opened this issue Mar 25, 2024 · 2 comments
Closed

kafkareceiver panic #31926

povilasv opened this issue Mar 25, 2024 · 2 comments
Labels
bug Something isn't working receiver/kafka

Comments

@povilasv
Copy link
Contributor

povilasv commented Mar 25, 2024

Component(s)

receiver/kafka

What happened?

Description

When trying to connect and getting some auth error from kafka, collector panics.

Steps to Reproduce

Expected Result

Actual Result

Collector version

v0.95.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

receivers:
  kafka:
    protocol_version: 3.5.1
    brokers: []
    topic: ExampleTopicName
    encoding: text
    auth:
      sasl:
        username: "user"
        password: "password"
        mechanism: "SCRAM-SHA-512"
exporters:
  coralogix: ..
service:
  telemetry:
    logs:
      level: "debug"
  pipelines:
    logs:
      receivers: [ kafka ]
      exporters: [ coralogix ]

Log output

2024-03-20T12:32:34.306Z        info    [email protected]/telemetry.go:55 Setting up own telemetry...
2024-03-20T12:32:34.307Z        info    [email protected]/telemetry.go:97 Serving metrics {"address": ":8888", "level": "Basic"}
2024-03-20T12:32:34.307Z        debug   [email protected]/exporter.go:273        Beta component. May change in the future.       {"kind": "exporter", "data_type": "logs", "name": "coralogix"}
2024-03-20T12:32:34.307Z        debug   [email protected]/receiver.go:294        Beta component. May change in the future.       {"kind": "receiver", "name": "kafka", "data_type": "logs"}
2024-03-20T12:32:34.308Z        info    [email protected]/service.go:143  Starting otelcol-contrib...     {"Version": "0.95.0", "NumCPU": 1}
2024-03-20T12:32:34.308Z        info    extensions/extensions.go:34     Starting extensions...
2024-03-20T12:32:34.308Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] Channel created     {"grpc_log": true}
2024-03-20T12:32:34.308Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] original dial target is: "ingress.coralogix.com:443"        {"grpc_log": true}
2024-03-20T12:32:34.308Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] parsed dial target is: resolver.Target{URL:url.URL{Scheme:"ingress.coralogix.com", Opaque:"443", User:(*url.Userinfo)(nil), Host:"", Path:"", RawPath:"", OmitHost:false, ForceQuery:false, RawQuery:"", Fragment:"", RawFragment:""}}     {"grpc_log": true}
2024-03-20T12:32:34.308Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] fallback to scheme "passthrough"    {"grpc_log": true}
2024-03-20T12:32:34.308Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] parsed dial target is: passthrough:///ingress.coralogix.com:443     {"grpc_log": true}
2024-03-20T12:32:34.308Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] Channel authority set to "ingress.coralogix.com:443"        {"grpc_log": true}
2024-03-20T12:32:34.309Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] Resolver state updated: {
  "Addresses": [
    {
      "Addr": "ingress.coralogix.com:443",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Metadata": null
    }
  ],
  "Endpoints": [
    {
      "Addresses": [
        {
          "Addr": "ingress.coralogix.com:443",
          "ServerName": "",
          "Attributes": null,
          "BalancerAttributes": null,
          "Metadata": null
        }
      ],
      "Attributes": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)     {"grpc_log": true}
2024-03-20T12:32:34.309Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] Channel switches to new LB policy "pick_first"      {"grpc_log": true}
2024-03-20T12:32:34.309Z        info    zapgrpc/zapgrpc.go:178  [core] [pick-first-lb 0xc0028d3b60] Received new config {
  "shuffleAddressList": false
}, resolver state {
  "Addresses": [
    {
      "Addr": "ingress.coralogix.com:443",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Metadata": null
    }
  ],
  "Endpoints": [
    {
      "Addresses": [
        {
          "Addr": "ingress.coralogix.com:443",
          "ServerName": "",
          "Attributes": null,
          "BalancerAttributes": null,
          "Metadata": null
        }
      ],
      "Attributes": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
}       {"grpc_log": true}
2024-03-20T12:32:34.309Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1 SubChannel #2] Subchannel created    {"grpc_log": true}
2024-03-20T12:32:34.309Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] Channel Connectivity change to CONNECTING   {"grpc_log": true}
2024-03-20T12:32:34.309Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] Channel exiting idle mode   {"grpc_log": true}
2024-03-20T12:32:34.310Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING  {"grpc_log": true}
2024-03-20T12:32:34.310Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1 SubChannel #2] Subchannel picks a new address "ingress.coralogix.com:443" to connect {"grpc_log": true}
2024-03-20T12:32:34.310Z        info    zapgrpc/zapgrpc.go:178  [core] [pick-first-lb 0xc0028d3b60] Received SubConn state update: 0xc0028d3ce0, {ConnectivityState:CONNECTING ConnectionError:<nil>}  {"grpc_log": true}
2024-03-20T12:32:34.578Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY       {"grpc_log": true}
2024-03-20T12:32:34.578Z        info    zapgrpc/zapgrpc.go:178  [core] [pick-first-lb 0xc0028d3b60] Received SubConn state update: 0xc0028d3ce0, {ConnectivityState:READY ConnectionError:<nil>}       {"grpc_log": true}
2024-03-20T12:32:34.578Z        info    zapgrpc/zapgrpc.go:178  [core] [Channel #1] Channel Connectivity change to READY        {"grpc_log": true}
2024-03-20T12:32:35.099Z        info    [email protected]/service.go:206  Starting shutdown...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x4802df7]

goroutine 1 [running]:
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver.(*kafkaLogsConsumer).Shutdown(0xc0028bca00, {0xc0028a9800, 0xc00227f1c8})
        github.com/open-telemetry/opentelemetry-collector-contrib/receiver/[email protected]/kafka_receiver.go:360 +0x37
go.opentelemetry.io/collector/service/internal/graph.(*Graph).ShutdownAll(0xc0028ac480, {0x9190520, 0xec535e0})
        go.opentelemetry.io/collector/[email protected]/internal/graph/graph.go:435 +0x1c8
go.opentelemetry.io/collector/service.(*Service).Shutdown(0xc00260f680, {0x9190520, 0xec535e0})
        go.opentelemetry.io/collector/[email protected]/service.go:212 +0xcf
go.opentelemetry.io/collector/otelcol.(*Collector).setupConfigurationComponents(0xc00282e8c0, {0x9190520, 0xec535e0})
        go.opentelemetry.io/collector/[email protected]/collector.go:191 +0x705
go.opentelemetry.io/collector/otelcol.(*Collector).Run(0xc00282e8c0, {0x9190520, 0xec535e0})
        go.opentelemetry.io/collector/[email protected]/collector.go:229 +0x52
go.opentelemetry.io/collector/otelcol.NewCommand.func1(0xc00283c000, {0x824286c?, 0x7?, 0x823af73?})
        go.opentelemetry.io/collector/[email protected]/command.go:27 +0x6c
github.com/spf13/cobra.(*Command).execute(0xc00283c000, {0xc0000b4b80, 0x2, 0x2})
        github.com/spf13/[email protected]/command.go:983 +0xabc
github.com/spf13/cobra.(*Command).ExecuteC(0xc00283c000)
        github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(0x85c8bb8?)
        github.com/spf13/[email protected]/command.go:1039 +0x13
main.runInteractive({0x85c8bb8, {{0x826dd88, 0xf}, {0x8305203, 0x1f}, {0x823f072, 0x6}}, 0x0, {0x0, 0x0}, ...})
        github.com/open-telemetry/opentelemetry-collector-releases/contrib/main.go:27 +0x3d
main.run(...)
        github.com/open-telemetry/opentelemetry-collector-releases/contrib/main_others.go:10
main.main()
        github.com/open-telemetry/opentelemetry-collector-releases/contrib/main.go:20 +0x118


### Additional context

_No response_
@povilasv povilasv added bug Something isn't working needs triage New item requiring triage labels Mar 25, 2024
Copy link
Contributor

Pinging code owners:

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

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Mar 25, 2024
@crobert-1
Copy link
Member

Thanks for filing and submitting a fix @povilasv, really appreciate it!

dmitryax pushed a commit that referenced this issue Mar 26, 2024
**Description:** Fixing panic on shutdown 

**Link to tracking Issue:** #31926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/kafka
Projects
None yet
Development

No branches or pull requests

2 participants