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

lookup_rdap error without allow_permutations #246

Closed
thesubtlety opened this issue Oct 10, 2019 · 2 comments
Closed

lookup_rdap error without allow_permutations #246

thesubtlety opened this issue Oct 10, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@thesubtlety
Copy link

Great library, thanks! Using version 1.1.0, I'm getting an error looking up rdap data unless I used the deprecated feature "allow_permutations" (#158). No idea why but wanted to drop a note if there's a bug somewhere. Some random reddit post has the same issue saying they've seen it with government IPs and occasional corporations - https://www.reddit.com/r/networking/comments/c5d5kk/how_to_handle_asn_registry_lookup_failed/

>>> import ipwhois
>>> ip = "33.3.69.247"

>>> ipwhois.IPWhois(address=ip).lookup_rdap()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/no/.local/lib/python3.5/site-packages/ipwhois/ipwhois.py", line 308, in lookup_rdap
get_asn_description=get_asn_description
File "/home/no/.local/lib/python3.5/site-packages/ipwhois/asn.py", line 498, in lookup                                                      
raise ASNRegistryError('ASN registry lookup failed. '
ipwhois.exceptions.ASNRegistryError: ASN registry lookup failed. Permutations not allowed.   

>>> ipwhois.IPWhois(address=ip, allow_permutations=True).lookup_rdap() 
/home/no/.local/lib/python3.5/site-packages/ipwhois/net.py:138: UserWarning: allow_permutations has been deprecated and will be removed. It is no longer needed, due to the deprecation of asn_alts, and the addition of the asn_methods argument.
 warn('allow_permutations has been deprecated and will be removed. '
{'raw': None, 'asn_cidr': 'NA', 'asn_country_code': 'US', 'asn': 'NA', 'query': '33.3.69.247', 'asn_date': '1991-01-01', 'asn_registry': 'arin', 'network': {'events': [{'actor': None, 'timestamp': '2013-09-11T17:57:18-04:00', 'action': 'last changed'}, {'actor': None, 'timestamp': '1991-01-01T00:00:00-05:00', 'action': 'registration'}], 'raw': None, 'status': ['active'], 'notices': [{'title': 'Terms of Service', 'links': ['https://www.arin.net/resources/registry/whois/tou/'], 'description': 'By using the ARIN RDAP/Whois service, you are agreeing to the RDAP/Whois Terms of Use'}, {'title': 'Whois Inaccuracy Reporting', 'links': ['https://www.arin.net/resources/registry/whois/inaccuracy_reporting/'], 'description': 'If you see inaccuracies in the results, please visit: '}, {'title': 'Copyright Notice', 'links': None, 'description': 'Copyright 1997-2019, American Registry for Internet Numbers, Ltd.'}], 'links': ['https://rdap.arin.net/registry/ip/33.0.0.0', 'https://whois.arin.net/rest/net/NET-33-0-0-0-1'], 'cidr': '33.0.0.0/8', 'ip_version': 'v4', 'country': None, 'type': 'DIRECT ALLOCATION', 'handle': 'NET-33-0-0-0-1', 'end_address': '33.255.255.255', 'parent_handle': None, 'start_address': '33.0.0.0', 'remarks': None, 'name': 'DISN-IP-LEGACY'}, 'objects': {'DNIC': {'events': [{'actor': None, 'timestamp': '2011-08-17T09:45:37-04:00', 'action': 'last changed'}], 'raw': None, 'events_actor': None, 'handle': 'DNIC', 'status': None, 'notices': None, 'contact': {'title': None, 'kind': 'org', 'address': [{'type': None, 'value': '3990 E. Broad Street\nColumbus\nOH\n43218\nUnited States'}], 'role': None, 'phone': None, 'email': None, 'name': 'DoD Network Information Center'}, 'links': ['https://rdap.arin.net/registry/entity/DNIC', 'https://whois.arin.net/rest/org/DNIC'], 'roles': ['registrant'], 'remarks': None, 'entities': ['MIL-HSTMST-ARIN', 'REGIS10-ARIN']}}, 'nir': None, 'asn_description': 'NA', 'entities': ['DNIC']}
@secynic secynic self-assigned this Mar 4, 2020
@secynic secynic added the bug label Mar 4, 2020
@trolldbois
Copy link

same here. I used the following workaround, without the permutations arg.

ipwhois.IPWhois(address=ip).lookup_rdap(asn_methods=['dns', 'whois', 'http'])

@secynic secynic added this to the 1.2.0 milestone Sep 1, 2020
@secynic
Copy link
Owner

secynic commented Sep 2, 2020

I removed the deprecated functionality in #230. Please try the dev branch. I am trying to expedite the next release.

@secynic secynic closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants