Torann / laravel-geoip

Determine the geographical location of website visitors based on their IP addresses.

Home Page:http://lyften.com/projects/laravel-geoip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geoip:update decompress download file incorrectly

TFnight opened this issue · comments

Hello sir,

Sorry for my poor English.

I met an error geoip.ERROR: MaxMind\Db\Reader\InvalidDatabaseException: The MaxMind DB file's search tree is corrupt after I run php artisan geoip:update.

Setting in config/geoip:
'update_url' => sprintf('https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=%s&suffix=tar.gz', env('MAXMIND_LICENSE_KEY')),

geoip:update will start downloading a file with .tar.gz extension from update url and then use gzopen to extract file.

I think the extracting method caused The MaxMind DB file's search tree is corrupt because I test other updating solution like the article.

Finally, it works!

Could you please help verify this problem?

Same problem here !
https://github.com/cydrobolt/polr is impacted by this bug !

Temp solution :

wget "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=LICENCE_KEY&suffix=tar.gz" -O GeoLite2-City.tar.gz
tar -xvf GeoLite2-City.tar.gz
cp GeoLite2-City_*/GeoLite2-City.mmdb storage/app/geoip.mmdb

Hope will get fixed soon ;)