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

IndexError: list index out of range happens sometimes on lookup_rdap() #334

Open
nil0x42 opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@nil0x42
Copy link

nil0x42 commented Nov 14, 2024

Here is a traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/ipwhois/asn.py", line 260, in parse_fields_whois
    ret = {'asn_registry': temp[4].strip(' \n')}
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/user/scripts/ipwhois/resolveIPWhois.py", line 364, in <module>
    for cidr, whois in resolver.process_ip(ip):
  File "/home/user/scripts/ipwhois/resolveIPWhois.py", line 58, in process_ip
    res = self._lookup(ipw.lookup_rdap)
  File "/home/user/scripts/ipwhois/resolveIPWhois.py", line 108, in _lookup
    res = self._lookup_retry(method)
  File "/home/user/scripts/ipwhois/resolveIPWhois.py", line 88, in _lookup_retry
    return method()
  File "/usr/local/lib/python3.10/dist-packages/ipwhois/ipwhois.py", line 299, in lookup_rdap
    asn_data = self.ipasn.lookup(
  File "/usr/local/lib/python3.10/dist-packages/ipwhois/asn.py", line 496, in lookup
    asn_data = self.parse_fields_whois(
  File "/usr/local/lib/python3.10/dist-packages/ipwhois/asn.py", line 281, in parse_fields_whois
    raise ASNParseError('Parsing failed for "{0}" with exception: {1}.'
ipwhois.exceptions.ASNParseError: Parsing failed for "" with exception: list index out of range.

It happens unfrequently, but happens.
I tried to reproduce the error with the impacted IPs, but every time i retried manually it worked.

Thank you for this wonderful library

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

1 participant