internetstandards / Internet.nl

Internet standards compliance test suite
https://internet.nl
176 stars 37 forks source link

Does not appear to be an IPv4 or IPv6 address #1207

Closed BRVN01 closed 10 months ago

BRVN01 commented 11 months ago

S.O version: Ubuntu 20.04.6 (LTS) Internet.nl version: 1.7.1 Python version: 3.8.10 Install method: released package

Hi guys, After installing internet.nl using the release package, I'm seeing the issue below when I run 'Test Your Connection':

Dec 11 10:18:11 *sanitized* python3[272106]: 2023-12-11 10:18:11        INFO     - "GET / HTTP/1.1" 200 10367
Dec 11 10:18:13 *sanitized* python3[272106]: 2023-12-11 10:18:13        INFO     - "GET /connection/ HTTP/1.1" 200 6649
Dec 11 10:18:13 *sanitized* python3[272106]: 2023-12-11 10:18:13        INFO     - "GET /connection/gettestid/?_=1702300693586 HTTP/1.1" 200 47
Dec 11 10:18:13 *sanitized* python3[272106]: 2023-12-11 10:18:13        INFO     - "GET /?callback=jQuery35106635225886179451_1702300693593&_=1702300693594 HTTP/1.1" 200 59
Dec 11 10:18:13 *sanitized* python3[272106]: 2023-12-11 10:18:13        INFO     - "GET /?callback=jQuery35106635225886179451_1702300693589&_=1702300693590 HTTP/1.1" 200 47
Dec 11 10:18:15 *sanitized* python3[272106]: 2023-12-11 10:18:15        INFO     - "GET /?callback=jQuery35106635225886179451_1702300693591&_=1702300693592 HTTP/1.1" 200 130
Dec 11 10:18:17 *sanitized* python3[272106]: 2023-12-11 10:18:17        ERROR    - Internal Server Error: /connection/addr-test/78ab620e561d45e7bad9ef05cea8f4e7/
Dec 11 10:18:17 *sanitized* python3[272106]: Traceback (most recent call last):
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/checks/tasks/routing.py", line 194, in ip_to_dns_query
Dec 11 10:18:17 *sanitized* python3[272106]:     ip = ipaddress.ip_address(ip_in)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/usr/lib/python3.8/ipaddress.py", line 53, in ip_address
Dec 11 10:18:17 *sanitized* python3[272106]:     raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
Dec 11 10:18:17 *sanitized* python3[272106]: ValueError: 'a.dns.br' does not appear to be an IPv4 or IPv6 address
Dec 11 10:18:17 *sanitized* python3[272106]: During handling of the above exception, another exception occurred:
Dec 11 10:18:17 *sanitized* python3[272106]: Traceback (most recent call last):
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl/.venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
Dec 11 10:18:17 *sanitized* python3[272106]:     response = get_response(request)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl/.venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
Dec 11 10:18:17 *sanitized* python3[272106]:     response = wrapped_callback(request, *callback_args, **callback_kwargs)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/interface/views/connection.py", line 451, in dec
Dec 11 10:18:17 *sanitized* python3[272106]:     resp = func(request, *args, **kw)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/interface/views/connection.py", line 478, in addr_ipv6
Dec 11 10:18:17 *sanitized* python3[272106]:     return network_ipv6(request, request_id)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/interface/views/connection.py", line 520, in network_ipv6
Dec 11 10:18:17 *sanitized* python3[272106]:     resolv = resolv_list(request.get_host(), test_id)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/interface/views/connection.py", line 430, in resolv_list
Dec 11 10:18:17 *sanitized* python3[272106]:     asn = find_AS_by_IP(resolver)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/interface/views/connection.py", line 357, in find_AS_by_IP
Dec 11 10:18:17 *sanitized* python3[272106]:     asns_prefixes = TeamCymruIPtoASN.asn_prefix_pairs_for_ip(None, ip)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/checks/tasks/routing.py", line 151, in asn_prefix_pairs_for_ip
Dec 11 10:18:17 *sanitized* python3[272106]:     ip2asn_query = TeamCymruIPtoASN.ip_to_dns_query(ip_in)
Dec 11 10:18:17 *sanitized* python3[272106]:   File "/opt/internetnl/Internet.nl-1.7.1/checks/tasks/routing.py", line 217, in ip_to_dns_query
Dec 11 10:18:17 *sanitized* python3[272106]:     raise InvalidIPError(f"Error parsing IP address {ip_in}.")
Dec 11 10:18:17 *sanitized* python3[272106]: checks.tasks.routing.InvalidIPError: Error parsing IP address a.dns.br.
Dec 11 10:18:17 *sanitized* python3[272106]: 2023-12-11 10:18:17        ERROR    - "GET /connection/addr-test/78ab620e561d45e7bad9ef05cea8f4e7/?callback=jQuery35106635225886179451_170230069>
Dec 11 10:18:17 *sanitized* python3[272106]: 2023-12-11 10:18:17        INFO     - "GET /connection/finished/78ab620e561d45e7bad9ef05cea8f4e7?_=1702300693597 HTTP/1.1" 200 2599
Dec 11 10:18:17 *sanitized* python3[272106]: 2023-12-11 10:18:17        INFO     - "GET /connection/78ab620e561d45e7bad9ef05cea8f4e7/results HTTP/1.1" 200 17837

P.S.: I also updated Celery to version 5.3.4. I have another server using the same settings as described above, but everything works fine.

baknu commented 10 months ago

It seems you are using v1.7.1 which is not the latest version. We recommend you to use the latest version (v1.8.*) that is Docker based: https://github.com/internetstandards/Internet.nl/releases

For documentation check: https://github.com/internetstandards/Internet.nl/blob/main/documentation/Docker.md

BRVN01 commented 10 months ago

Thanks. I found the problem. It's inside the redis-server. I don't know the cause, but it occurred after migrating the PostgreSQL and redis-server databases to another server, using a new version of Internetnl. After running 'flush' in redis, it works fine.

baknu commented 10 months ago

Ok, thanks for your feedback. Closing the issue for now.