Your software
My Mautic version is: 2.15.3
My PHP version is: 7.2
Your problem
My problem is: GeoLite2 City Download, Automatically fetching the IP lookup data failed.
This message is from Maxmind.com
*Starting December 30, 2019, we will be requiring users of our GeoLite2 databases to register for a MaxMind account and obtain a license key in order to download GeoLite2 databases.
*Starting December 30, 2019, downloads will no longer be served from our public GeoLite2 page, from geolite.maxmind.com/download/geoip/database/
I can update the database manually, hoping to do this automatically.
These errors are showing in the log:
[2020-01-02 13:17:02] mautic.ERROR: Failed to fetch remote IP data: Could not resolve host: geolite.maxmind.com
[2020-01-02 13:17:02] mautic.NOTICE: PHP Notice - Undefined variable: data - in file **\wordpress\mautic\app\bundles\CoreBundle\IpLookup\AbstractLocalDataLookup.php - at line 90 {âconnectorâ:"[object] (Joomla\Http\Http: {})",âpackageâ:âhttp://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz",âexceptionâ:"[object] (RuntimeException(code: 0): Could not resolve host: geolite.maxmind.com at **\wordpress\mautic\vendor\joomla\http\src\Transport\Curl.php:185)â,âtempTargetâ:" **\wordpress\mautic\app\cache\prod/GeoLite2-City.mmdb.gz",âtempExtâ:âgzâ,âlocalTargetâ:" **\wordpress\mautic\app\cache\prod/âŚ/ip_data/GeoLite2-City.mmdb",âlocalTargetExtâ:âmmdbâ,âsuccessâ:false,âmemLimitâ:134217728,âfreeMemâ:91146192}
[2020-01-02 13:17:02] mautic.NOTICE: PHP Notice - Trying to get property âbodyâ of non-object - in file
**\wordpress\mautic\app\bundles\CoreBundle\IpLookup\AbstractLocalDataLookup.php - at line 90 {âconnectorâ:"[object] (Joomla\Http\Http: {})",âpackageâ:âhttp://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz",âexceptionâ:"[object] (RuntimeException(code: 0): Could not resolve host: geolite.maxmind.com at \wordpress\mautic\vendor\joomla\http\src\Transport\Curl.php:185)",âtempTargetâ:"\wordpress\mautic\app\cache\prod/GeoLite2-City.mmdb.gzâ,âtempExtâ:âgzâ,âlocalTargetâ:"*\wordpress\mautic\app\cache\prod/âŚ/ip_data/GeoLite2-City.mmdb",âlocalTargetExtâ:âmmdbâ,âsuccessâ:false,âmemLimitâ:134217728,âfreeMemâ:91146192}
Steps I have tried to fix the problem:
I registered for a MaxMind account and obtained a license key. Entered IP lookup service authentication using format username:password. Iâve tried username:password to access maxmind.com and userID:Licenscekey (they are different)
Reading my log i thought it might be a memory issue. Increase my PHP limit to 256M and i get error log to show my this now:
[2020-01-02 14:51:39] mautic.WARNING: PHP Warning - gzdecode(): data error - in file **\wordpress\mautic\app\bundles\CoreBundle\IpLookup\AbstractLocalDataLookup.php - at line 91 {âconnectorâ:"[object] (Joomla\Http\Http: {})",âpackageâ:âhttp://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz",âexceptionâ:"[object] (RuntimeException(code: 0): Could not resolve host: geolite.maxmind.com at **\wordpress\mautic\vendor\joomla\http\src\Transport\Curl.php:185)â,âtempTargetâ:" **\millwrightsites.com\wordpress\mautic\app\cache\prod/GeoLite2-City.mmdb.gz",âtempExtâ:âgzâ,âlocalTargetâ:" **\wordpress\mautic\app\cache\prod/âŚ/ip_data/GeoLite2-City.mmdb",âlocalTargetExtâ:âmmdbâ,âsuccessâ:false,âmemLimitâ:268435456,âfreeMemâ:225364000}
I am quite new with Mautic. And first time playing with this platform. However, when i finished set up Mautic I am stucked at the GeoIP GeoLite2 City from maxmind. I could not fetch it to update the new data.
I follow this tips https://github.com/mautic/mautic/issues/8275
However, I am still stucked at the last step. Put in the folder. I put the file exactly where the path shown with File Manager in Cpanel and grand the permission for read/write etc⌠Put the issue can not solve yet. Any ideas please. Thank you so much.
This solution does not fix the fetch button. This solution takes place of the fetch. Everything your doing in theses steps is what the fetch button does automatically. Mautic will update there code soon to give us a solution.
For those administering their Mautic instance from the command line, the best way to transfer the GeoLite2-City.mmdb file to the app/cache/ip_data/ folder is using the scp command line utility.
First, comment out the automatic update cron job in /etc/crontab (system-wide crontab) or user-specific crontab, crontab -u www-data -e with a # symbol.
Then, simply upload the .tar.gz file downloaded from your MaxMind account to your home directory (e.g. /home/ubuntu/GeoLite2-City_20200107.tar.gz) then using the tar -xvzf command, extract the archive. Inside the extracted folder, you will find the GeoLite2-City.mmdb which you should cp to /path/to/mautic/app/cache/ip_data/. If asked to overwrite, type y to indicate âyes.â
Finally, change ownership of the file to the web server user (e.g. apache or www-data) for good measure. chown -R www-data:www-data /path/to/mautic/app/cache/ip_data/GeoLite2-City.mmdb
Just a note.
After you have manually copy-paste the database and disabled the cron job, DONâT click on the button âUpdate IP lookup data storeâ anymore because it will empty the database that you have just copied.
Does anybody maybe know how we can trigger the Location update for the contacts that are now without the location??
Thanks,
Davor
Thanks Davor. That would be the issue which I did. After manually copy-paste and disable cron job. I immediately click the update button to refresh lookup data!!!
Thanks very much for this. One question though, so thereâs nothing that we need to do to let Mautic know how/where to access the DBâs?
My install is not typical in that I use Runcloud to manage my VPS. The webroot dirâs are different from a dedicated server. I modified the paths when it came to ip_data (/home/mautic/webapps/Mautic/app/cache/ip_data) but noticed I didnât have that folder in the existing Mautic install, I had to create it. So how does Mautic know to get the geo data from that folder? Or am I missing something?
***EDIT:
On further inspection. I do have a ip_data folder but that is in Mautic/var/cache/ip_data
Another point, does making ip_data chmod 777 not scare the crap out of you?