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

Raspberry Pi panic: runtime error: invalid memory address or nil pointer dereference #1704

Closed
superbool opened this issue Sep 3, 2016 · 14 comments
Labels
bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution panic issue that results in panics from Telegraf

Comments

@superbool
Copy link

Hello :
I'm using Raspberry PI 2B+,and the OS is Raspbian, the Telegraf is Standalone Binaries (ARM)
but when I run telegraf,I get the error:

2016/09/03 19:51:38 Using config file: /etc/telegraf/telegraf.conf
2016/09/03 19:51:38 Starting Telegraf (version 0.13.2)
2016/09/03 19:51:38 Loaded outputs: influxdb
2016/09/03 19:51:38 Loaded inputs: swap system cpu disk diskio kernel mem processes
2016/09/03 19:51:38 Tags enabled: host=raspberrypi
2016/09/03 19:51:38 Agent Config: Interval:10s, Debug:false, Quiet:false, Hostname:"raspberrypi", Flush Interval:10s 
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x21f0ac]

goroutine 36 [running]:
panic(0x9cd960, 0x1120a038)
        /usr/local/go/src/runtime/panic.go:481 +0x330
github.com/influxdata/telegraf/plugins/inputs/system.(*systemPS).DiskUsage(0x10b6778, 0x0, 0x0, 0x0, 0x112bbcc0, 0x2, 0x2, 0x0, 0x0, 0x0, ...)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/system/ps.go:87 +0x4a4
github.com/influxdata/telegraf/plugins/inputs/system.(*DiskStats).Gather(0x1126a480, 0x76efb508, 0x11300d80, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/system/disk.go:44 +0xb8
github.com/influxdata/telegraf/agent.gatherWithTimeout.func1(0x112c20c0, 0x112e28a0, 0x11300d80)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:174 +0x8c
created by github.com/influxdata/telegraf/agent.gatherWithTimeout
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:175 +0xb8

What can I do ?

@sparrc sparrc added bug unexpected problem or unintended behavior panic issue that results in panics from Telegraf labels Sep 3, 2016
@sparrc
Copy link
Contributor

sparrc commented Sep 5, 2016

looks like it's the disk plugin that is panicking. It's not possible for me to reproduce this so if anyone can submit a PR it would be hugely appreciated.

@sparrc sparrc added the help wanted Request for community participation, code, contribution label Sep 5, 2016
@slezko
Copy link

slezko commented Dec 4, 2016

Hello! Same situation on Ubuntu 14.04. Telegraf worked for a few months but yesterday it failed with panic:

2016/12/03 10:31:40 Output [influxdb] buffer fullness: 104 / 10000 metrics. Total gathered metrics: 11283511. Total dropped metrics: 0.
2016/12/03 10:31:40 Output [influxdb] wrote batch of 104 metrics in 46.669798ms
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x63fd09]

goroutine 4516357 [running]:
panic(0x107ebc0, 0xc820010080)
        /usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/telegraf/plugins/inputs/system.(*systemPS).DiskUsage(0x1c78550, 0x0, 0x0, 0x0, 0xc8201f7760, 0x2, 0x2, 0x0, 0x0, 0x0, ...)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/system/ps.go:87 +0x829
github.com/influxdata/telegraf/plugins/inputs/system.(*DiskStats).Gather(0xc8201f82a0, 0x7fc52a815dc8, 0xc82251f3b0, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/system/disk.go:44 +0xd9
github.com/influxdata/telegraf/agent.gatherWithTimeout.func1(0xc8213beae0, 0xc8201c48a0, 0xc82251f3b0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:174 +0x73
created by github.com/influxdata/telegraf/agent.gatherWithTimeout
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:175 +0xe0

@lfarkas
Copy link

lfarkas commented Jan 29, 2017

does it means currently there is not any working telegraf for raspberry? anyway for me the above problem seems to be a little bit different, but can be the cause of the same problem...:-(
anyway we just start to investigate whether to write our own collector or enhance telegraf for our needs. as this bug is already half year long it seems nobody really cares about telegraf on arm...does it true?

@sparrc
Copy link
Contributor

sparrc commented Jan 30, 2017

Please submit a PR for telegraf if you have the resources, I do not have a raspberry Pi to test and can't fix this myself.

from what I can tell it is only panicking on raspberry, and not on other ARM systems.

@lfarkas
Copy link

lfarkas commented Jan 30, 2017

the packaging problem is only the minor problem, the real problem is the segfault. anyway I don't know the way the arm tar.gz created so I can't fix it:-(

@sparrc
Copy link
Contributor

sparrc commented Jan 30, 2017

What packaging problem? what does that have to do with this?

@lfarkas
Copy link

lfarkas commented Jan 30, 2017

see #2337

@sparrc
Copy link
Contributor

sparrc commented Jan 30, 2017

it gets created in scripts/build.py

@lfarkas
Copy link

lfarkas commented Jan 31, 2017

just change this line:
tar_command = "cd {} && tar -cvzf {}.tar.gz ./".format(package_build_root, name)
to this:
tar_command = "cd {} && tar -cvzf {}.tar.gz --owner=root ./
".format(package_build_root, name)
regards.

@lfarkas
Copy link

lfarkas commented Feb 4, 2017

is there any debug version or anything else we can help with this issue?

@sparrc
Copy link
Contributor

sparrc commented Feb 4, 2017

nope, sorry, right now I'm hoping someone will take this on and submit a PR

@lfarkas
Copy link

lfarkas commented Feb 5, 2017

ok i found another bug since form the arm tar.gz the /etc/telegraf/telegraf.d missing it's also missing on my machine too. and since the service file start the service as
/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d
that cause the crash. anyway i'm still belive then telegraf should have to be more fault tolerant and handle the missing directory. so it's still a bug. or at least should have to report the cause of the crash!

after that i comment out all inputs section from the config file which also cause another segfault without any usable error message.

these should have to be fixed or at least reported.

@nwneisen
Copy link
Contributor

Is anyone still having an issue with this? I'm running telegraf a RPi3 with raspbian lite and I'm not seeing any issues. I'm using telegraf 1.12.5 using swap, system, cpu, disk, diskio, kernel, mem, and processes input plugins and outputting to influxDB_v2 on my local machine.

@danielnelson
Copy link
Contributor

I'll bet many of the arm specific bugs in Go have been worked out over the years. Let's close this one and if anyone still has related problems please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution panic issue that results in panics from Telegraf
Projects
None yet
Development

No branches or pull requests

6 participants