Your software
My Mautic version is: 6.0.0
My PHP version is: 8.3.x
Your problem
I have setup GeoLite2 city locations however the cron job does create a log file or log anything. However if I run the console command from ssh I get the following error. Is this a bug ?
In AbstractLocalDataLookup.php line 99:
Call to a member function getBody() on null
mautic:iplookup:download
Has anyone in the community or a beta tester successfully got GeoLite2 City IP lookup to work in Mautic 6.0.0 ? Mautic does not appear to be downloading the database see my last post.
I have manually downloaded the database however anonymous IPâs are not being resolved into city names etc Are there any extra configuration steps except for those in System Settings and setting up a cron job for downloading ?
It would be great to get this feature working sooner rather than later. Is it supported in Mautic 6.0.0 ?
MaxMinds GeoLite2 IP lookup feature must have has two distinct parts.
Part 1
This involves downloading the database from MaxMinds via a cron job to update the one already stored i.e. to keep it up to date.
Part 2
Resolving IP addresses against the stored database when anonymous activity occurs.
The cron job reports the error as defined in a earlier post so downloading is not completing successfully.
I have manually download the database. However Mautic does not appear to replace the anonymous ip address with a city name when you look at anonymous contacts. Or does it function in a different way than I expect ? That means iplookup is not occurring against a downloaded database. Which means neither part is working.
Is anyone using or has used GeoLite2 IP address lookup in V5 or V6 that could provide some guidance on how it should all work ? I would appreciate some help.
As the command is failing I manually downloaded the database from MaxMinds using the license id as the username and key as the password and I loaded the database to /public_html/app/cache/ip_data which confirms my MaxMinds logon credentials are working.
I configured Mautic System IPLookkUp using those same credentials - Is that correct ? Have I put the file in the correct directory ? Are any other cron jobs needed for this feature to work ?
I manually installed Mautic on our test web platform and it appears to be working ok except for this feature so far. I didnât use composer as I donât know what it does and I prefer not to break my test platform at this late stage of testing.
I will check out the logs and post again shortly. If you could answer the above in the meantime I would be grateful.
The Mautic log is now reporting an invalid key error every time the console command runs. But the console command reports a vague Null error as uploaded. May be the error reporting of the command could be improved to more accurately reflect the error ?
I was able to manually logon with the same credentials. I donât think there was a typo in the Mautic configuration.
To save time I created another MaxMind GeoLite2 key and changed the Mautic configuration accordingly. The console command now reports success each time the command runs in ssh.
I will check if iplookup is working with anonymous IPs shortly.
Your software
My Mautic version is: 6.0.0
My PHP version is: 8.3
My Database type and version is:
Your problem
My problem is: Localisation doesnât work
These errors are showing in the log:
Steps I have tried to fix the problem: I have read like every available blog about how to set up maxmind in Mautic but I stil canât see my subscribers country/city
The maxmind city file (GeoLite2-City.mmdb) is hosted on my âŠ/var/cache/ip_data folder
I have Maxmind - Geolite2 City Download selected in my settings and used my maxmin licence and the user:password format for no aval.
Can someone please guide me like child to set this up?
In case another service works fine and easier, Iâm also down for it - I just want to be able to segment my list based on the core country I serve
We spun up an instance and got it working immediately. We did install Mautic 6 with composer, maybe you can look at the tutorial we had written up on how to install mautic 6.
Other things i can suggest is to make sure you save your email:password for maxmind in the UI configuration screen.
SSH into your terminal and run the import command /var/www/mautic/bin/console mautic:iplookup:download
see what the results you get there are. if there are no errors, go back to the UI/UX and try and fetch the DB again,
then give it a shot.
Some things to look for are your mautic logs which are found in /var/www/mautic/var/logs/
and maybe your webserver logs (like nginx) /var/logs/nginx/access.log or something like that
âAre you running it is sudo ?â I donât know - Iâm a marketer, so I just copy/paste code where Iâm told to lol.
Hereâs the errors form the logs file. Thereâs the âIMAP Connection is already closed errorâ but I didnât include in order to focus on this one :
[2025-04-22T10:40:15.200816+00:00] console.CRITICAL: Error thrown while running command âmautic:iplookup:downloadâ. Message: âCall to a member function getBody() on nullâ {âexceptionâ:â[object] (Error(code: 0): Call to a member function getBody() on null at /home/diaspvsw/inbox.yiriwgol.com/app/bundles/CoreBundle/IpLookup/AbstractLocalDataLookup.php:99)â,âcommandâ:âmautic:iplookup:downloadâ,âmessageâ:âCall to a member function getBody() on nullâ} {âhostnameâ:ânode19-ca.n0c.comâ,âpidâ:1220600}
[2025-04-22T10:40:15.204376+00:00] php.CRITICAL: Uncaught Error: Call to a member function getBody() on null {âexceptionâ:â[object] (Error(code: 0): Call to a member function getBody() on null at /home/diaspvsw/inbox.yiriwgol.com/app/bundles/CoreBundle/IpLookup/AbstractLocalDataLookup.php:99)â} {âhostnameâ:ânode19-ca.n0c.comâ,âpidâ:1220600}
I reported my solution earlier up the thread, I will summarise again below:-
The Mautic log is reporting an invalid key error every time the console command runs. But the console command reports a vague Null error as uploaded.
The first MaxMind key i created was the root of the problem - it did not work.
To save time I created a second MaxMind GeoLite2 key and changed the Mautic configuration accordingly. With this second key the console command now reports success each time the command runs in ssh.
And GeoLite2 now stores the city location against the anonymous contact in Mautic.
The vague console command error was reporting an invalid key error in my case. Maybe the console command could be updated to report an invalid key error to help everyone diagnose the problem.