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

Telegraf v1.22.1 panics when pulling metrics from Couchbase CE v5.0.1 #11017

Closed
joelsdc opened this issue Apr 22, 2022 · 1 comment · Fixed by #11045
Closed

Telegraf v1.22.1 panics when pulling metrics from Couchbase CE v5.0.1 #11017

joelsdc opened this issue Apr 22, 2022 · 1 comment · Fixed by #11045
Labels
area/couchbase bug unexpected problem or unintended behavior

Comments

@joelsdc
Copy link

joelsdc commented Apr 22, 2022

Relevant telegraf.conf

[[inputs.couchbase]]
    servers = ["http://user:pass@couchbase1.example.com:8091"]

Logs from Telegraf

2022-04-22T02:08:28Z I! Starting Telegraf 1.22.1
2022-04-22T02:08:28Z I! Loaded inputs: couchbase
2022-04-22T02:08:28Z I! Loaded aggregators:
2022-04-22T02:08:28Z I! Loaded processors:
2022-04-22T02:08:28Z W! Outputs are not used in testing mode!
2022-04-22T02:08:28Z I! Tags enabled: host=telegraf.example.com
2022-04-22T02:08:28Z D! [agent] Initializing plugins
2022-04-22T02:08:28Z D! [agent] Starting service inputs
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase1.example.com:8091 memory_free=18208051200,memory_total=50630598656 1650593308000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase2.example.com:8091 memory_free=17832468480,memory_total=50630606848 1650593308000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase3.example.com:8091 memory_free=18767409152,memory_total=50630606848 1650593308000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase4.example.com:8091 memory_free=17904566272,memory_total=50630598656 1650593308000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase5.example.com:8091 memory_free=17882521600,memory_total=50630606848 1650593308000000000
panic: runtime error: index out of range [-1]

goroutine 37 [running]:
github.com/influxdata/telegraf/plugins/inputs/couchbase.(*Couchbase).addBucketFieldChecked(0xc0000ce270, 0xc000b66e41, {0x53c7557, 0xc0004de660}, {0xc0004e8a00, 0x536144e, 0x915d723f9c9050fa}, 0xc000617b60)
    /go/src/github.com/influxdata/telegraf/plugins/inputs/couchbase/couchbase.go:373 +0xea
github.com/influxdata/telegraf/plugins/inputs/couchbase.(*Couchbase).gatherDetailedBucketStats(0x49a51e0, {0xc000b66e41, 0x3b}, {0xc0004de660, 0x6}, 0x0)
    /go/src/github.com/influxdata/telegraf/plugins/inputs/couchbase/couchbase.go:143 +0xee
github.com/influxdata/telegraf/plugins/inputs/couchbase.(*Couchbase).gatherServer(0xc0000ce270, {0x5edcb20, 0xc0004032a0}, {0xc000b66e41, 0x3b})
    /go/src/github.com/influxdata/telegraf/plugins/inputs/couchbase/couchbase.go:122 +0xc12
github.com/influxdata/telegraf/plugins/inputs/couchbase.(*Couchbase).Gather.func1({0xc000b66e41, 0x0})
    /go/src/github.com/influxdata/telegraf/plugins/inputs/couchbase/couchbase.go:75 +0x7f
created by github.com/influxdata/telegraf/plugins/inputs/couchbase.(*Couchbase).Gather
    /go/src/github.com/influxdata/telegraf/plugins/inputs/couchbase/couchbase.go:73 +0x1bd

System info

Telegraf 1.22.1, Debian 9.13

Docker

No response

Steps to reproduce

1. telegraf --config couchbase.conf --test --debug

Expected behavior

No panics!

Actual behavior

Telegraf panics

Additional info

Using: Couchbase CE 5.0.1 build 5003

NOTE: With Telegraf v1.16.3 and the same config we get the metrics with no panics:

2022-04-22T02:22:26Z I! Starting Telegraf 1.16.3
2022-04-22T02:22:26Z D! [agent] Initializing plugins
2022-04-22T02:22:26Z D! [agent] Starting service inputs
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase1.example.com:8091 memory_free=18184151040,memory_total=50630598656 1650594147000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase2.example.com:8091 memory_free=17816256512,memory_total=50630606848 1650594147000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase3.example.com:8091 memory_free=18760634368,memory_total=50630606848 1650594147000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase4.example.com:8091 memory_free=17893912576,memory_total=50630598656 1650594147000000000
> couchbase_node,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com,hostname=couchbase5.example.com:8091 memory_free=17863499776,memory_total=50630606848 1650594147000000000
> couchbase_bucket,bucket=cas_tgt,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com data_used=184455980533,disk_fetches=0,disk_used=228852459951,item_count=33705518,mem_used=76277631736,ops_per_sec=8,quota_percent_used=78.93231152660317 1650594147000000000
> couchbase_bucket,bucket=cas_st,cluster=http://couchbase1.example.com:8091,host=telegraf.example.com item_count=24250,mem_used=790521566,ops_per_sec=136,quota_percent_used=1.227050966893633 1650594147000000000
2022-04-22T02:22:26Z D! [agent] Stopping service inputs
2022-04-22T02:22:26Z D! [agent] Input channel closed
2022-04-22T02:22:26Z D! [agent] Stopped Successfully
@joelsdc joelsdc added the bug unexpected problem or unintended behavior label Apr 22, 2022
@sspaink
Copy link
Contributor

sspaink commented Apr 27, 2022

Looks like this is a similar issue as: #9764 which unfortunately doesn't have a solution. I have a feeling it is an issue with the go package we are using to communicate with couchbase and migrating to the current official package could be the solution to fixing this. More info here: #9813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/couchbase bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants