Skip to content

Clickhouse Plugin: runtime error at ReplicationQueue #9398

@ADovgalyuk

Description

@ADovgalyuk

OS: CentOS8
Telegraf: telegraf-1.19.0-1.x86_64
Clickhouse: version 21.6.4 revision 54448. Single node instance, no replication.
Configuration:

[root@centos8-tst telegraf.d]# cat click.conf 
# Read metrics from one or many ClickHouse servers
[[inputs.clickhouse]]
  username = "default"
  servers  = ["http://192.168.109.103:8123"]
  auto_discovery = false

Telegraf_Test:

[root@centos8-tst telegraf.d]# telegraf --test --config click.conf 
2021-06-18T13:29:30Z I! Starting Telegraf 1.19.0
> clickhouse_tables,database=graphite,host=centos8-tst,source=192.168.109.103,table=graphite bytes=168207913i,parts=18i,rows=406317574i 1624022970000000000
> clickhouse_tables,database=graphite,host=centos8-tst,source=192.168.109.103,table=graphite_index bytes=286745i,parts=9i,rows=206843i 1624022970000000000
> clickhouse_tables,database=graphite,host=centos8-tst,source=192.168.109.103,table=graphite_tagged bytes=44882767i,parts=12i,rows=5019899i 1624022970000000000
> clickhouse_tables,database=statistics,host=centos8-tst,source=192.168.109.103,table=http_sms_cdr bytes=5266i,parts=1i,rows=100i 1624022970000000000
> clickhouse_tables,database=system,host=centos8-tst,source=192.168.109.103,table=asynchronous_metric_log bytes=5247i,parts=3i,rows=624i 1624022970000000000
> clickhouse_tables,database=system,host=centos8-tst,source=192.168.109.103,table=asynchronous_metric_log_0 bytes=17451554i,parts=11i,rows=7337554i 1624022970000000000
> clickhouse_tables,database=system,host=centos8-tst,source=192.168.109.103,table=metric_log bytes=172991i,parts=5i,rows=679i 1624022970000000000
> clickhouse_tables,database=system,host=centos8-tst,source=192.168.109.103,table=metric_log_0 bytes=875912046i,parts=13i,rows=8984691i 1624022970000000000
> clickhouse_tables,database=system,host=centos8-tst,source=192.168.109.103,table=trace_log bytes=5863784i,parts=12i,rows=79151i 1624022970000000000
panic: runtime error: index out of range [0] with length 0

goroutine 32 [running]:
github.com/influxdata/telegraf/plugins/inputs/clickhouse.(*ClickHouse).replicationQueue(0xc00086c6c0, 0x5648b38, 0xc000648500, 0xc00084ad80, 0x0, 0x0)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/clickhouse/clickhouse.go:334 +0x333
github.com/influxdata/telegraf/plugins/inputs/clickhouse.(*ClickHouse).Gather(0xc00086c6c0, 0x5648b38, 0xc000648500, 0x0, 0x0)
	/go/src/github.com/influxdata/telegraf/plugins/inputs/clickhouse/clickhouse.go:212 +0x176
github.com/influxdata/telegraf/agent.(*Agent).testRunInputs.func2(0xc0004648b0, 0xc00013f8e0, 0xc000116b40, 0xc0006484c0, 0xc000114280)
	/go/src/github.com/influxdata/telegraf/agent/agent.go:403 +0x222
created by github.com/influxdata/telegraf/agent.(*Agent).testRunInputs
	/go/src/github.com/influxdata/telegraf/agent/agent.go:372 +0x109

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions