Closed mitchkramez closed 5 years ago
AH! Figured it out! The command that downloads the database doesn't check to ensure the file is valid. I'm adding a check now. Also did you use the correct license key in place of the MYLICENSEKEYHERE
in the user?
I would suggest making it an environment variable and using it in your config file like this:
'update_url' => 'https://download.maxmind.com/app/geoip_download?edition_id=GeoIP2-City&date=20160216&suffix=tar.gz&license_key=' . env('GEOIP_USER_ID', 'MYLICENSEKEYHERE')
Torann, Yes, I was using our license key when I ran the update. I'll try and pull down the latest, and give it another shot.
Thanks!
Ok. You'll have to update your composer.json
file to point to torann/geoip 1.0.*
.
Also have a look at the update guide
@Torann
Old ticket, but the main issue is that the Paid URL returns a tar file and MaxMindDatabase Class is expecting a gz file.
If we verbosely run the geoipupdate (https://github.com/maxmind/geoipupdate) command we can see that there is another URL to get just the db file that is built using a challenge hash. As well it send the md5 of the db file so no downloads when the file is still relevant.
I would be happy to assist with a pull request, to make geoip:update work like the geoipupdate command. But would just need to figure out a way to differentiate between the Lite and Paid Subscription in the code. Perhaps if the config contains a license_key, product_id and user_id you use the subscription method, and if not than use the lite method. Any thoughts?
ubuntu@hf2-dev:~$ sudo geoipupdate -v geoipupdate 2.4.0 Opened License file /etc/GeoIP.conf UserId XXXXX LicenseKey XXXXXX Insert product_id GeoIP2-City Insert product_id GeoIP2-Country Read in license key /etc/GeoIP.conf Number of product ids 2 url: https://updates.maxmind.com/app/update_getfilename?product_id=GeoIP2-City md5hex_digest: 3cc8743948b0953b59ea6010a4bf6b9a url: https://updates.maxmind.com/app/update_getipaddr Client IP address: 96.22.71.127 md5hex_digest2 (challenge): 293bad65d9f84aa06e99cecfccb907a0 url: https://updates.maxmind.com/app/update_secure?db_md5=3cc8743948b0953b59ea6010a4bf6b9a&challenge_md5=293bad65d9f84aa06e99cecfccb907a0&user_id=65782&edition_id=GeoIP2-City No new updates available
url: https://updates.maxmind.com/app/update_getfilename?product_id=GeoIP2-Country md5hex_digest: a1e2bce9c7f40c4be98f71227e56345c url: https://updates.maxmind.com/app/update_getipaddr Client IP address: 96.22.71.127 md5hex_digest2 (challenge): 293bad65d9f84aa06e99cecfccb907a0 url: https://updates.maxmind.com/app/update_secure?db_md5=a1e2bce9c7f40c4be98f71227e56345c&challenge_md5=293bad65d9f84aa06e99cecfccb907a0&user_id=65782&edition_id=GeoIP2-Country No new updates available
Running a geoip:update when using the paid update URL doesn't work. It reports the update was successful, but when it first gets accessed, it returns:
The MaxMind DB file's search tree is corrupt
. I manually downloaded it from the URL, and placed in the correct spot, and all was well. I'm using this url for the update url:https://download.maxmind.com/app/geoip_download?edition_id=GeoIP2-City&date=20160216&suffix=tar.gz&license_key=MYLICENSEKEYHERE
I'm guessing it has something to do with the redirects, but let me know if I can be of more help here.