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

invalid memory address or nil pointer dereference Error #169

Closed
vivekbny opened this issue Jun 6, 2017 · 16 comments
Closed

invalid memory address or nil pointer dereference Error #169

vivekbny opened this issue Jun 6, 2017 · 16 comments

Comments

@vivekbny
Copy link

vivekbny commented Jun 6, 2017

Hi,

I am getting invalid memory address error when using snmp v3 authentication.
The exporter was working fine with snmpv2 devices with default_if_index module.
Below is the error, yml config , snmpbulwalk command output from the box.

image

image

image

@vivekbny vivekbny changed the title invalid memory address or nil pointer dereference invalid memory address or nil pointer dereference Error Jun 6, 2017
@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

Can you run the exporter with -log.level=deubg and attach a text copy (not a screenshot) of the output?

@RichiH
Copy link
Member

RichiH commented Jun 6, 2017

@SuperQ was minimally faster, so my only remaining point: Please change your login credentials and take care to blank/remove everything, ideally making even the length of the strings invisible to anyone you send this to.

@vivekbny
Copy link
Author

vivekbny commented Jun 6, 2017

@SuperQ and @RichiH thanks for your reply.
Here is the text with the output.
snmpexporter output.txt

@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

I traced the error, it looks like it's coming from the upstream SNMP code. I will have to see if there are any related upstream issues filed/fixed.

@vivekbny
Copy link
Author

vivekbny commented Jun 6, 2017

Thanks @SuperQ for your time.
Will wait for the resolution.
Hope i can get the snmp metrics scraped soon.

@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

There's nothing specific upstream that I can find after a quick glance through the changes. However it looks like the v3 auth has been refactored since we released the last snmp_exporter. I propose we update the vendoring and test again.

@vivekbny
Copy link
Author

vivekbny commented Jun 6, 2017

okay

@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

If possible, can you build a version of the snmp_exporter from master?

@vivekbny
Copy link
Author

vivekbny commented Jun 6, 2017

Never done them before.
i will give a try to build from master.

@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

If you have a Golang compiler/build env setup, it should be as easy as go get github.com/prometheus/snmp_exporter and the binary will end up in the bin dir of your build env.

@vivekbny
Copy link
Author

vivekbny commented Jun 6, 2017

No i have not setup Golang
I am off on wed will be back on Thursday to check this.
Meanwhile, is the docker version of the image from dockerhub uses a different buid?
https://hub.docker.com/r/prom/snmp-exporter/
If this image is a latest build can i try with this.
Thanks for your help @SuperQ

@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

Here is a snmp_exporter test binary built for Linux x86-64.

snmp_exporter.gz

@vivekbny
Copy link
Author

vivekbny commented Jun 6, 2017

Thanks @SuperQ
Iam now able to scrape the metrics using snmpv3 auth using the new binary you have provided.

image

Thanks again :)

@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

Great! We'll have to make a new official release that contains the updated vendor code.

@SuperQ SuperQ mentioned this issue Jun 6, 2017
@SuperQ SuperQ closed this as completed Jun 6, 2017
@SuperQ
Copy link
Member

SuperQ commented Jun 6, 2017

FYI, I've made an official release of the new version.

@tricycleHack
Copy link

Hi,

the problem seems to be back:

Using version 0.12.0 with docker image.
SNMPv3 with authPriv mode

Configured everything in configs accordingly:
version: 3
max_repetitions: 25
retries: 3
timeout: 20s
auth: 
security_level: authPriv
username: user
password: safePassword
auth_protocol: SHA
priv_protocol: AES
priv_password: privatePassword

snmpwalk is working with the device, so the problem is not on the side of the device for sure. From log.level=debug returns:

snmp-exporter_1         | time="2018-10-24T13:30:17Z" level=debug msg="Scraping target '192.168.1.1:161' with module 'if_mib'" source="main.go:86"
snmp-exporter_1         | time="2018-10-24T13:30:17Z" level=debug msg="Walking target \"192.168.1.1:161\" subtree \"1.3.6.1.2.1.1.3\"" source="collector.go:125"
snmp-exporter_1         | time="2018-10-24T13:30:17Z" level=info msg="Error scraping target 192.168.1.1:161: Error walking target 192.168.178.6: recover: runtime error: invalid memory address or nil pointer dereference" source="collector.go:180"
snmp-exporter_1         | time="2018-10-24T13:30:17Z" level=debug msg="Scrape of target '192.168.1.1:161' with module 'if_mib' took 60.002449 seconds" source="main.go:97"

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

4 participants