Mautic:iplookup:download ssh console command reports error on line 99

Hello,

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

Thanks

Hello,

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 ?

Thanks.

Hello,

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.

Thanks.

Hi,

We spun up an instance to see if we could replicate the problem, however everything from our side worked fine.

Installed Mautic 6 with composer.

Set it all up,
put into IPLookup our maxmind username:password
Opened up a terminal and ran /bin/console mautic:iplookup:download
Got success.

Went and hit the mautic instance from an anonymous browser and it picked up the location.

Screenshot 2025-04-16 at 16.26.50

Can you put the logs from /var/www/mautic/var/logs/latest log here
as well as your webserver log results.

Hello,

Thanks for spinning up a test Mautic 6 build and confirming that GeoLite2 does indeed work.

When I run php bin/console mautic:iplookup:download I get the following error:

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.

Thanks.

Hello,

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.

Thanks for your help.

1 Like