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

i have a error in mycode:caused by <class 'IndexError'>: pop from empty list #417

Open
rationa1 opened this issue Apr 26, 2022 · 4 comments

Comments

@rationa1
Copy link

I am confused. I didn't do anything,But sometimes my code doesn't work

ERROR:conpot.protocols.snmp.conpot_cmdrsp:poll error: Traceback (most recent call last):
; File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dispatch.py", line 46, in runDispatcher
use_poll=True, map=self.__sockMap, count=1)
; File "/usr/lib64/python3.6/asyncore.py", line 207, in loop
poll_fun(timeout, map)
; File "/usr/lib64/python3.6/asyncore.py", line 188, in poll2
readwrite(obj, flags)
; File "/usr/lib64/python3.6/asyncore.py", line 123, in readwrite
obj.handle_error()
; File "/usr/lib64/python3.6/asyncore.py", line 110, in readwrite
obj.handle_write_event()
; File "/usr/lib64/python3.6/asyncore.py", line 442, in handle_write_event
self.handle_write()
; File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 142, in handle_write
outgoingMessage, transportAddress = self.__outQueue.pop()
;IndexError: pop from empty list
caused by <class 'IndexError'>: pop from empty list
2022-04-26 20:45:41,407 poll error: Traceback (most recent call last):
; File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dispatch.py", line 46, in runDispatcher
use_poll=True, map=self.__sockMap, count=1)
; File "/usr/lib64/python3.6/asyncore.py", line 207, in loop
poll_fun(timeout, map)
; File "/usr/lib64/python3.6/asyncore.py", line 188, in poll2
readwrite(obj, flags)
; File "/usr/lib64/python3.6/asyncore.py", line 123, in readwrite
obj.handle_error()
; File "/usr/lib64/python3.6/asyncore.py", line 110, in readwrite
obj.handle_write_event()
; File "/usr/lib64/python3.6/asyncore.py", line 442, in handle_write_event
self.handle_write()
; File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 142, in handle_write
outgoingMessage, transportAddress = self.__outQueue.pop()
;IndexError: pop from empty list
caused by <class 'IndexError'>: pop from empty list
2022-04-26 20:45:41,409 Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dispatch.py", line 46, in runDispatcher
use_poll=True, map=self.__sockMap, count=1)
File "/usr/lib64/python3.6/asyncore.py", line 207, in loop
poll_fun(timeout, map)
File "/usr/lib64/python3.6/asyncore.py", line 188, in poll2
readwrite(obj, flags)
File "/usr/lib64/python3.6/asyncore.py", line 123, in readwrite
obj.handle_error()
File "/usr/lib64/python3.6/asyncore.py", line 110, in readwrite
obj.handle_write_event()
File "/usr/lib64/python3.6/asyncore.py", line 442, in handle_write_event
self.handle_write()
File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 142, in handle_write
outgoingMessage, transportAddress = self.__outQueue.pop()
IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "../conpot/protocols/snmp/conpot_cmdrsp.py", line 170, in handleMgmtOperation
rspVarBinds = self.proxy.getRequest(snmp_version, oid, **user_info)
File "../conpot/protocols/snmp/snmp_proxy.py", line 65, in getRequest
ObjectIdentity(*args)
File "/usr/local/lib/python3.6/site-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py", line 183, in getCmd
**kwargs):
File "/usr/local/lib/python3.6/site-packages/pysnmp/hlapi/asyncore/sync/cmdgen.py", line 113, in getCmd
snmpEngine.transportDispatcher.runDispatcher()
File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dispatch.py", line 50, in runDispatcher
raise PySnmpError('poll error: %s' % ';'.join(format_exception(*exc_info())))
pysnmp.error.PySnmpError: poll error: Traceback (most recent call last):
; File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dispatch.py", line 46, in runDispatcher
use_poll=True, map=self.__sockMap, count=1)
; File "/usr/lib64/python3.6/asyncore.py", line 207, in loop
poll_fun(timeout, map)
; File "/usr/lib64/python3.6/asyncore.py", line 188, in poll2
readwrite(obj, flags)
; File "/usr/lib64/python3.6/asyncore.py", line 123, in readwrite
obj.handle_error()
; File "/usr/lib64/python3.6/asyncore.py", line 110, in readwrite
obj.handle_write_event()
; File "/usr/lib64/python3.6/asyncore.py", line 442, in handle_write_event
self.handle_write()
; File "/usr/local/lib/python3.6/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 142, in handle_write
outgoingMessage, transportAddress = self.__outQueue.pop()
;IndexError: pop from empty list
caused by <class 'IndexError'>: pop from empty list

@rationa1
Copy link
Author

I don't even know what went wrong, I hope to hear from you soon

@gmunumel
Copy link

Exactly same error for me.

@rationa1, Do you manage to fix it?

@lextm
Copy link

lextm commented Jul 15, 2023

@ericoschuch what you commented has nothing to do with the original issue.

@lextm
Copy link

lextm commented Mar 1, 2024

Since asyncore and Python 3.6 are both considered deprecated, this isn't something anyone should spend more time on.

asyncio based API should be used instead.

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

3 participants