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

[receiver/mongodbatlas] Panic in collecting event logs #19191

Closed
cpheps opened this issue Mar 3, 2023 · 3 comments · Fixed by #19193
Closed

[receiver/mongodbatlas] Panic in collecting event logs #19191

cpheps opened this issue Mar 3, 2023 · 3 comments · Fixed by #19193
Assignees
Labels
bug Something isn't working needs triage New item requiring triage receiver/mongodbatlas

Comments

@cpheps
Copy link
Contributor

cpheps commented Mar 3, 2023

Component(s)

receiver/mongodbatlas

What happened?

Description

The MongoDB Atlas receiver is panicking when storage client fails to init.

Steps to Reproduce

Create a config with file_storage that the user running the collector doesn't have access to.

Expected Result

Graceful failure with an error message

Actual Result

Panic

invalid memory address or nil pointer dereference. Panic stacktrace: goroutine 91 [running]:
runtime/debug.Stack()
    /opt/hostedtoolcache/go/1.19.6/x64/src/runtime/debug/stack.go:24 +0x65
github.com/observiq/observiq-otel-collector/collector.(*collector).Run.func1.1()
    /home/runner/work/observiq-otel-collector/observiq-otel-collector/collector/collector.go:114 +0x5d
panic({0x55a7e60, 0xaaa9370})
    /opt/hostedtoolcache/go/1.19.6/x64/src/runtime/panic.go:884 +0x212
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver.(*eventsReceiver).checkpoint(0xc00124e320, {0x6fa40d8, 0xc0000d2280})
    /home/runner/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver@v0.72.0/events.go:235 +0x90
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver.(*eventsReceiver).Shutdown(0xc00124e320, {0x6fa40d8, 0xc0000d2280})
    /home/runner/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver@v0.72.0/events.go:117 +0x85
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver.(*combinedLogsReceiver).Shutdown(0xc00124b398, {0x6fa40d8, 0xc0000d2280})
    /home/runner/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver@v0.72.0/combined_logs.go:73 +0xdd
go.opentelemetry.io/collector/service.(*pipelinesGraph).ShutdownAll(0x0?, {0x6fa40d8, 0xc0000d2280})
    /home/runner/go/pkg/mod/go.opentelemetry.io/collector@v0.72.0/service/graph.go:296 +0xc9
go.opentelemetry.io/collector/service.(*Service).Shutdown(0xc00019a600, {0x6fa40d8, 0xc0000d2280})
    /home/runner/go/pkg/mod/go.opentelemetry.io/collector@v0.72.0/service/service.go:172 +0xd9
go.opentelemetry.io/collector/otelcol.(*Collector).setupConfigurationComponents(0xc000a26300, {0x6fa40d8, 0xc0000d2280})
    /home/runner/go/pkg/mod/go.opentelemetry.io/collector@v0.72.0/otelcol/collector.go:183 +0x628
go.opentelemetry.io/collector/otelcol.(*Collector).Run(0xc000a26300, {0x6fa40d8, 0xc0000d2280})
    /home/runner/go/pkg/mod/go.opentelemetry.io/collector@v0.72.0/otelcol/collector.go:207 +0x65
github.com/observiq/observiq-otel-collector/collector.(*collector).Run.func1()
    /home/runner/work/observiq-otel-collector/observiq-otel-collector/collector/collector.go:131 +0xc5
created by github.com/observiq/observiq-otel-collector/collector.(*collector).Run
    /home/runner/work/observiq-otel-collector/observiq-otel-collector/collector/collector.go:107 +0x512
","stacktrace":"main.main
    /home/runner/work/observiq-otel-collector/observiq-otel-collector/cmd/collector/main.go:113
runtime.main
    /opt/hostedtoolcache/go/1.19.6/x64/src/runtime/proc.go:250

Collector version

v0.72.0

Environment information

No response

OpenTelemetry Collector configuration

receivers:
  mongodbatlas:
    public_key: $MONGODB_ATLAS_PUBLIC_KEY
    private_key: $MONGODB_ATLAS_PRIVATE_KEY
    events:
      projects:
        - name: "Login PoC Sandbox"
          exclude_clusters:
          - "ccs-audit"
      poll_interval: 30s
      types: []
    storage: file_storage

extensions:
  file_storage:
    directory: /folder_no_perms/ # don't have permissions to write to this folder

exporters:
  logging:

service:
  extensions: [file_storage]
  pipelines:
    logs:
      receivers:
      - mongodbatlas
      exporters:
      - logging

Log output

No response

Additional context

No response

@cpheps cpheps added bug Something isn't working needs triage New item requiring triage labels Mar 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

Pinging code owners:

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

@cpheps
Copy link
Contributor Author

cpheps commented Mar 3, 2023

CC: @schmikei as I think you wrote the event log collection.

@schmikei
Copy link
Contributor

schmikei commented Mar 3, 2023

Yep if I could be assigned to this, I'll cut a PR shortly to hopefully fix this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/mongodbatlas
Projects
None yet
2 participants