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/bigip] nil pointer deference code path in getpoolmembers #31899

Closed
paebersold-tyro opened this issue Mar 21, 2024 · 3 comments
Closed
Assignees

Comments

@paebersold-tyro
Copy link
Contributor

Component(s)

receiver/bigip

What happened?

Description

If we are unable to collect a list of pools, when we try to collect the list of pool members we encounter a nil pointer dereference and the collector process crashes

Steps to Reproduce

Accessing a BigIp device but using a user without access to pool information

Expected Result

Handle pools being unavailable better

Actual Result

SIGSEGV and crash

Collector version

v0.91

Environment information

Environment

OS: Suse 12sp5

OpenTelemetry Collector configuration

receivers:
  bigip:
    collection_interval: 30s
    endpoint: https://1.2.3.4:443
    username: bigipuser
    password: xxx
    tls:
      insecure_skip_verify: true
exporters:
  debug:
    verbosity: normal
service:
  pipelines:
    metrics:
      receivers:
      - bigip  
      processors: []
      exporters:
      - debug

Log output

2024-03-21T00:53:46.987Z        warn    bigipreceiver@v0.91.0/scraper.go:90     Failed to scrape pool metrics       {"kind": "receiver", "name": "bigip", "data_type": "metrics", "error": "non 200 code returned 401"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2d26439]

goroutine 85 [running]:
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/bigipreceiver.(*bigipClient).GetPoolMembers(0xc000625950, {0x42b7ac0, 0xc0005e5080}, 0x0)
        github.com/open-telemetry/opentelemetry-collector-contrib/receiver/bigipreceiver@v0.91.0/client.go:158 +0x59
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/bigipreceiver.(*bigipScraper).scrape(0xc0005b2070, {0x42b7ac0, 0xc0005e5080})
        github.com/open-telemetry/opentelemetry-collector-contrib/receiver/bigipreceiver@v0.91.0/scraper.go:100 +0x734
go.opentelemetry.io/collector/receiver/scraperhelper.ScrapeFunc.Scrape(...)
        go.opentelemetry.io/collector/receiver@v0.91.0/scraperhelper/scraper.go:20
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport(0xc0007172c0)
        go.opentelemetry.io/collector/receiver@v0.91.0/scraperhelper/scrapercontroller.go:197 +0x16b
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1()
        go.opentelemetry.io/collector/receiver@v0.91.0/scraperhelper/scrapercontroller.go:172 +0xd1
created by go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping in goroutine 1
        go.opentelemetry.io/collector/receiver@v0.91.0/scraperhelper/scrapercontroller.go:158 +0x4f

Additional context

No response

@paebersold-tyro paebersold-tyro added bug Something isn't working needs triage New item requiring triage labels Mar 21, 2024
Copy link
Contributor

Pinging code owners:

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

@Frapschen Frapschen removed the needs triage New item requiring triage label Mar 22, 2024
djaglowski pushed a commit that referenced this issue Mar 26, 2024
)

**Description:** fix nil pointer bug in receiver bigip

**Link to tracking Issue:**
[31899](#31899)

If GetPools has an error, pools is set to nil. However we then use this
nil pointer in GetPoolMembers which results in a crash.
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

@github-actions github-actions bot added the Stale label May 22, 2024
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2024
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