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

arm package: nil pointer deref on startup due to absent /etc/telegraf/telegraf.d #2770

Closed
aelse opened this issue May 6, 2017 · 4 comments
Closed

Comments

@aelse
Copy link

aelse commented May 6, 2017

Discovered this running up telegraf on a raspberry pi. This problem is mentioned tangentially in #1704 but I didn't find an open issue for it.

The arm bundle does not include /etc/telegraf/telegraf.d but the bundled init script uses this path for the config dir arg and the process terminates during startup (see detail in syslog extract below).

Telegraf should be tolerant of a missing config directory, or gracefully handle termination if it's intended that it should stop when the config directory does not exist. If config dir is mandatory then it should be present in the arm bundle.

May 6 03:41:57 astro systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB. May 6 03:41:58 astro telegraf[1726]: panic: runtime error: invalid memory address or nil pointer dereference May 6 03:41:58 astro telegraf[1726]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x14 pc=0xc6044] May 6 03:41:58 astro telegraf[1726]: goroutine 1 [running]: May 6 03:41:58 astro telegraf[1726]: panic(0xad9df0, 0x1141c008) May 6 03:41:58 astro telegraf[1726]: /usr/local/go/src/runtime/panic.go:500 +0x33c May 6 03:41:58 astro telegraf[1726]: github.com/influxdata/telegraf/internal/config.(*Config).LoadDirectory.func1(0xbe9f4f3a, 0x18, 0x0, 0x0, 0x105c420, 0x114cc6e0, 0x0, 0x0) May 6 03:41:58 astro telegraf[1726]: /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/internal/config/config.go:509 +0x30 May 6 03:41:58 astro telegraf[1726]: path/filepath.Walk(0xbe9f4f3a, 0x18, 0x1141c938, 0x0, 0x0) May 6 03:41:58 astro telegraf[1726]: /usr/local/go/src/path/filepath/path.go:396 +0x8c May 6 03:41:58 astro telegraf[1726]: github.com/influxdata/telegraf/internal/config.(*Config).LoadDirectory(0x11777720, 0xbe9f4f3a, 0x18, 0x0, 0x0) May 6 03:41:58 astro telegraf[1726]: /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/internal/config/config.go:522 +0x6c May 6 03:41:58 astro telegraf[1726]: main.reloadLoop(0x117c8f40, 0x0, 0x0) May 6 03:41:58 astro telegraf[1726]: /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:211 +0x11b4 May 6 03:41:58 astro telegraf[1726]: main.main() May 6 03:41:58 astro telegraf[1726]: /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:342 +0x74 May 6 03:41:58 astro systemd[1]: telegraf.service: main process exited, code=exited, status=2/INVALIDARGUMENT May 6 03:41:58 astro systemd[1]: Unit telegraf.service entered failed state.

@danielnelson
Copy link
Contributor

What version of Telegraf is this happening with?

@aelse
Copy link
Author

aelse commented May 10, 2017

@danielnelson Telegraf v1.2.1 (git: release-1.2 3b6ffb3)

@danielnelson
Copy link
Contributor

It looks like this has been fixed in master, and will be in the 1.3 release. 9e810ac

You can try the release candidate now: #2733

@danielnelson
Copy link
Contributor

Duplicate of #2466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants