Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Lotus Input metric loop panics when remote API is unavailable #1

Open
placer14 opened this issue May 13, 2020 · 0 comments
Open

Lotus Input metric loop panics when remote API is unavailable #1

placer14 opened this issue May 13, 2020 · 0 comments
Labels
kind/bug Something isn't working P1 P1: Must be resolved

Comments

@placer14
Copy link
Contributor

placer14 commented May 13, 2020

Relevant telegraf.conf:

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = "ns"

  hostname = ""
  omit_hostname = false

[[outputs.influxdb]]
  urls = ["http://127.0.0.1:8086"]
  database = "lotus"

[[outputs.postgresql]]
  connection = "host=localhost user=postgres password=password sslmode=disable"

[[inputs.lotus]]
  auth_token = ""

  lotus_data = "${HOME}/.lotus"

System info:

Telegraf unknown (git: HEAD b6162687)

ubuntu@telegraf-dev:~/sentinel$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"

Steps to reproduce:

  1. Lotus is running as normal with Telegraf listening.
  2. Shutdown Lotus before shutting down Telegraf.

Expected behavior:

Telegraf should gracefully fail without panicking and wait for lotus to become available again.
Bonus: Should probably report errors as well.

Actual behavior:

ubuntu@telegraf-dev:~/sentinel$ 2020-05-13T14:42:00Z D! [outputs.influxdb] Wrote batch of 1 metrics in 1.955066ms
2020-05-13T14:42:00Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2020-05-13T14:42:00Z D! [outputs.postgresql] Wrote batch of 1 metrics in 4.628493ms
2020-05-13T14:42:00Z D! [outputs.postgresql] Buffer fullness: 0 / 10000 metrics
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x1a4976f]

goroutine 129846440 [running]:
github.com/influxdata/telegraf/plugins/inputs/lotus.recordBlockHeaderPoints(0x4092a20, 0xc000137bc0, 0x40b2dc0, 0xc0002a85e0, 0xbfa71fae52166054, 0x135a6a67a89dc, 0x5f88bc0, 0x0, 0xc000314768, 0x8e5fa0)
        /home/ubuntu/sentinel/telegraf/plugins/inputs/lotus/lotus.go:175 +0x8f
github.com/influxdata/telegraf/plugins/inputs/lotus.processHeader(0x4092a20, 0xc000137bc0, 0x40b2dc0, 0xc0002a85e0, 0x0, 0xbfa71fae52166054, 0x135a6a67a89dc, 0x5f88bc0)
        /home/ubuntu/sentinel/telegraf/plugins/inputs/lotus/lotus.go:155 +0x9b
created by github.com/influxdata/telegraf/plugins/inputs/lotus.(*lotus).Start.func3
        /home/ubuntu/sentinel/telegraf/plugins/inputs/lotus/lotus.go:126 +0x116
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x1a4976f]

Additional info:

N/A

@iand iand added kind/bug Something isn't working P1 P1: Must be resolved labels Feb 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working P1 P1: Must be resolved
Projects
None yet
Development

No branches or pull requests

2 participants