mirrorbits loses ability to use GeoIP after GeoLite update
Each time I update the GeoLite2-City.mmdb and GeoLite2-ASN.mmdb files, mirrorbits apparently immediately loses the ability to read them. Any subsequent ?mirrorlist request says We were not able to use your IP to approximate your location, so have chosen the mirrors at random..
Running mirrorbits reload solves it.
Replacing the files on disk is enough to trigger the issue?
Yes, I simply copy the new files over the ones that are being used.
Most likely, the database is changed in-place. I verified that maxminddb-golang opens the database with os.Open and keeps the file descriptor open. Therefore, the updater should unlink the current database, then write the new database to the path and finally mirrorbits reload should be called (perhaps triggered by a systemd path unit or a comparable mechanism).
@stormi Which updater are you using?
I'm not using an updater. I have a simple script that downloads the database and extracts it then copies files over the the ones known to mirrorbits. The point of this issue is that mirrorbits should ideally, without a manual reload, 1. detect that the database it has opened doesn't exist anymore 2. load the new file... Rather than silently losing any ability to query the database.