nitefood / asn

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / URL / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup API server / Web traceroute server
MIT License
1.35k stars 163 forks source link

Parse error in "Prefix informations" section #70

Closed ideamatrix closed 2 months ago

ideamatrix commented 3 months ago

Looking up AS1031 this morning, I was seeing a parse error in the "Prefix informations" section. It's transient -- happens more often than not, but it's not always reproducible. It occurs with and without the -v switch.

I haven't been able to reproduce the error with other ASN's. I've tried loading the asn-neighbours JSON shown immediately before the error in Firefox multiple times, and wasn't able to find an instance where Firefox was unable to parse the data. However, since the issue doesn't always occur, neither of those are entirely definitive statements. With AS1031, I can reproduce the error about 50% of the time.

I'm running version 0.76.1 on Ubuntu 20.04.6 LTS (WSL2)

image

Text version of screenshot (for easy copy/paste)

``` ╭─────────────────────────────────────────────────╮ │ Prefix informations for AS1031 (PEER1-1031, US) │ ╰─────────────────────────────────────────────────╯ [2024-07-05 09:20:36] DEBUG curl -m5 -s https://stat.ripe.net/data/routing-status/data.json?resource=AS1031&sourceapp=nitefood-asn [2024-07-05 09:20:37] DEBUG curl -m5 -s https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS1031&sourceapp=nitefood-asn parse error: Unfinished JSON term at EOF at line 617, column 0 parse error: Unfinished JSON term at EOF at line 617, column 0 parse error: Unfinished JSON term at EOF at line 617, column 0 [2024-07-05 09:20:43] DEBUG curl -m10 -s https://stat.ripe.net/data/announced-prefixes/data.json?resource=1031&sourceapp=nitefood-asn [2024-07-05 09:20:46] DEBUG curl -m5 -s https://stat.ripe.net/data/prefix-overview/data.json?resource=23.145.72.0/24&sourceapp=nitefood-asn [2024-07-05 09:20:47] DEBUG curl -m5 -s https://stat.ripe.net/data/rir-stats-country/data.json?resource=AS1031 [2024-07-05 09:20:49] DEBUG curl -m5 -s https://stat.ripe.net/data/prefix-overview/data.json?resource=38.0.0.0/8&sourceapp=nitefood-asn [2024-07-05 09:20:50] DEBUG curl -m5 -s https://stat.ripe.net/data/rir-stats-country/data.json?resource=AS174 IPv4 Prefixes ────> 14 IPv6 Prefixes ────> 5 ```

nitefood commented 3 months ago

hey @ideamatrix,

based on what you describe it could be either a timeout during the RIPESTAT API query or an invalid reponse from it. Please try adjusting the timeout value (-m5) for that specific query to a much higher (e.g. -m100) value to see if that sorts it.

Thanks for reporting!

nitefood commented 2 months ago

I've doubled the curl timeout on that API call in v0.77.0. Furthermore this version includes an improved -v mode that outputs all API call response data to logfile, so that may come in handy while debugging this specific issue.

Please reopen the issue if the fix is not definitive.

Thanks!