You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Configure the receiver with collect_cluster_metrics == false and no username or password.
Connect to an Aerospike host with authentication enabled.
wait for scrape_interval.
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
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.
The text was updated successfully, but these errors were encountered:
Describe the bug
When running a pipeline with the Aerospike receiver with
collect_cluster_metrics
set to false andusername
andpassword
empty, the receiver will crash if auth fails with Aerospike error NOT_AUTHENTICATED. Incorrect passwords are fine but no user/pass gets NOT_AUTHENTICATEDSteps to reproduce
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?
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 likenamespace/<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.
The text was updated successfully, but these errors were encountered: