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/aerospikereceiver] Single node mode with authentication crashes if auth fails. #12979

Closed
dwelch-spike opened this issue Aug 5, 2022 · 3 comments
Assignees
Labels
bug Something isn't working priority:p1 High receiver/aerospike

Comments

@dwelch-spike
Copy link
Contributor

dwelch-spike commented Aug 5, 2022

Describe the bug
When running a pipeline with the Aerospike receiver with collect_cluster_metrics set to false and username and password empty, the receiver will crash if auth fails with Aerospike error NOT_AUTHENTICATED. Incorrect passwords are fine but no user/pass gets NOT_AUTHENTICATED

Steps to reproduce

  1. Configure the receiver with collect_cluster_metrics == false and no username or password.
  2. Connect to an Aerospike host with authentication enabled.
  3. wait for scrape_interval.
  4. observe crash.

What did you expect to see?
A logged warning containing the NOT_AUTHENTICATED error.

What did you see instead?
panic: runtime error: index out of range [1] with length 1

What version did you use?
Version: main at 9b2a885

What config did you use?

receivers:
    aerospike:
      endpoint: "172.17.0.7:3000"
      tlsname: ""
      collect_cluster_metrics: false
      collection_interval: 5s
      username: ""
      password: ""

processors:
  batch:

exporters:
  logging:

service:
  telemetry:
    logs:
      level: "debug"
  pipelines:
    metrics:
      receivers: [aerospike]
      processors: [batch]
      exporters: [logging]

Environment
OS: macOS 11.3.1
compiler: go version go1.18.2 darwin/amd64

Additional context
This crash happens because the Aerospike Go client single conn struct's RequestInfo method won't return an error if not authenticated, instead an error message is set in the key of the map return value. The client's allNamespaceInfo method assumes the keys in RequestInfo's return value look like namespace/<name> and splits on "/" then takes the index [1] causing an index out of bounds crash.

This should be fixed by checking for the "ERROR:" suffix in responses an returning an error if it is found.

@dwelch-spike dwelch-spike added the bug Something isn't working label Aug 5, 2022
@dwelch-spike
Copy link
Contributor Author

I'm working on a fix for this now.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2022

Pinging code owners: @djaglowski @antonblock. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@dwelch-spike
Copy link
Contributor Author

resolved by merged PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p1 High receiver/aerospike
Projects
None yet
Development

No branches or pull requests

2 participants