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

SystemError: <built-in function walk> returned NULL without setting an error (3.7) #108

Open
lroellin opened this issue Oct 15, 2018 · 12 comments · Fixed by #129
Open

SystemError: <built-in function walk> returned NULL without setting an error (3.7) #108

lroellin opened this issue Oct 15, 2018 · 12 comments · Fixed by #129
Labels

Comments

@lroellin
Copy link

@lroellin lroellin commented Oct 15, 2018

When running on an non-existing device with version 0.2.5:

try:
    snmp_walk(base_oid_id, hostname=ip_address_.compressed, community=snmp_v2_community, version=2)
except EasySNMPError as e:
    raise SnmpV2Exception(str(e))

I get SystemError: <built-in function walk> returned NULL without setting an error

When running with Python 3.6.6, I get the expected behavior (raised EasySNMPError)

@andy-shady-org
Copy link

@andy-shady-org andy-shady-org commented Nov 16, 2018

Hi, I am also seeing this error when using easysnmp within the get call:

reply = self.snmp.get(snmp_oid)

File "/Users/andy/projects/venv-python37/lib/python3.7/site-packages/easysnmp-0.2.5-py3.7-macosx-10.13-x86_64.egg/easysnmp/session.py", line 315, in get
interface.get(self, varlist)
SystemError: returned NULL without setting an error
DEBUG:web2py.app.onboard:{'error': ' returned NULL without setting an error'}

easysnmp==0.2.5

@henry-feng
Copy link

@henry-feng henry-feng commented Nov 23, 2018

I have the same failure for python 3.7, @andy-shady-org @lroellin would you like to share your fix of this bug? thanks

@lroellin
Copy link
Author

@lroellin lroellin commented Nov 23, 2018

I have no fix currently other than to downgrade to 3.6. Seems like Python expects a few more things from C extensions with 3.7...

That said, I don't have an alternative for this library. The other ones I've found are really low-level, whereas this feels pythonic

@nerosketch
Copy link

@nerosketch nerosketch commented Sep 16, 2019

i was run it with little fixes under python3.7. Pull Request already wait for confirmation. I hope it will help anyone.
#117

@ngie-eign
Copy link

@ngie-eign ngie-eign commented Dec 7, 2019

i was run it with little fixes under python3.7. Pull Request already wait for confirmation. I hope it will help anyone.
#117

I reviewed the code and it looks like it would actually break error reporting.

The problem is that some of the end-points are failing to set errors/create exceptions before returning NULL: https://stackoverflow.com/a/8450880 .

I'll look at fixing this, given that our project needs to move to python 3.7+ anyhow >_>...

@0weights
Copy link

@0weights 0weights commented Feb 11, 2020

i was run it with little fixes under python3.7. Pull Request already wait for confirmation. I hope it will help anyone.
#117

I reviewed the code and it looks like it would actually break error reporting.

The problem is that some of the end-points are failing to set errors/create exceptions before returning NULL: https://stackoverflow.com/a/8450880 .

I'll look at fixing this, given that our project needs to move to python 3.7+ anyhow >_>...

hey did you find a solution for this problem

@nerosketch
Copy link

@nerosketch nerosketch commented Feb 23, 2020

I was updated my branch, please check it again anyone. I wasn't familiar with the subject. Now more errors return correctly, but I not tested all functions, only netsnmp_get and netsnmp_walk.

@ngie-eign
Copy link

@ngie-eign ngie-eign commented Feb 26, 2020

@sayed797: hey did you find a solution for this problem

Nope. I've been way too busy...

@itheodoridis
Copy link

@itheodoridis itheodoridis commented May 12, 2020

I am having a similar issue (I guess it's the same) when using the check_ip_sla nagios plugin which uses easysnmp. The python version is 3.8.2.

@uedvt359
Copy link
Contributor

@uedvt359 uedvt359 commented Jan 5, 2022

Pinging possibly interested people: I am proposing a different, much smaller, patch for this at #129.

@kamakazikamikaze
Copy link
Owner

@kamakazikamikaze kamakazikamikaze commented Mar 16, 2022

I recommend pulling the latest source and testing it to see if your issue is resolved. (Assuming that you're still using this package.)

@Taxelas
Copy link

@Taxelas Taxelas commented Jun 11, 2022

In my case it was wrong community string

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

Successfully merging a pull request may close this issue.

10 participants