maxmind / MaxMind-DB-Reader-python

Python MaxMind DB reader extension
https://maxminddb.readthedocs.org/
Apache License 2.0
178 stars 37 forks source link

Running into issues with storing and querying 2001::/32 #171

Closed ac-hj closed 2 months ago

ac-hj commented 2 months ago

Hello, I'm seeing an issue with querying IP's in 2001::/32, where I'm constantly getting an empty query result despite storing this prefix in the MMDB file. To give more context, I'm currently using Go writer library to write prefixes from a CSV file to an MMDB file. Given that this specific prefix is a bogon, I'm setting IncludeReservedNetworks to true. I also have DisableIPv4Aliasing to true as I was seeing an aliasing issue with storing 2001::/32 otherwise.

To query the MMDB file, I'm using this Python reader library, but whenever I query an IP (e.g., 2001:0034:abcd:1234:5678::) that is part of 2001::/32, I'm seeing None. What's interesting is that I'm able to correctly query for IP's in other prefixes that I have stored in this MMDB file. I'm not sure why it's having an issue with 2001::/32 specifically; it'd be very helpful to get any insights here.

Thank you!

oschwald commented 2 months ago

This library doesn't do anything specific with this network. It sounds like the issue is likely related to the writing of the MMDB. Can you see the network with mmdblookup or when using the Go reader?

ac-hj commented 2 months ago

It's a bit odd, because with mmdblookup, I see Could not find an entry for this IP address (2001:0034:abcd:1234:5678::). However, if I search for other IP's like 2001:: or 2001:0000:0000:0000:0000::, I see, the result.

oschwald commented 2 months ago

This doesn't sound like a bug in the Python reader. I'll close this. If you want to open an issue against the writer, we could take a look at it there. Please include enough information to be able to reproduce the results, preferably a small example program that produces a database that doesn't match what you are expecting.

ac-hj commented 2 months ago

Just opened up a new issue: https://github.com/maxmind/mmdbwriter/issues/94