Torann / laravel-geoip

Determine the geographical location of website visitors based on their IP addresses.
http://lyften.com/projects/laravel-geoip
BSD 2-Clause "Simplified" License
2.07k stars 372 forks source link

Trying to get property 'status' of non-object error #179

Closed Kovbo closed 4 years ago

Kovbo commented 4 years ago

Dear members, the package works fine, but I'm receiving the following error after every request recorded in the geoip.log.

geoip.ERROR: ErrorException: Trying to get property 'status' of non-object in /var/www/laravel/vendor/torann/geoip/src/Services/IPApi.php:74 Stack trace: #0 /var/www/laravel/vendor/torann/geoip/src/Services/IPApi.php(74): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var/www/larav...', 74, Array) #1 /var/www/laravel/vendor/torann/geoip/src/GeoIP.php(148): Torann\GeoIP\Services\IPApi->locate('97.141.156.87')

The log size increased dramatically up to 14GB and crashed my production server. What may cause this problem?

The problem might be related to bug #142. Are there any ways to bypass this error? I have to clear my geoip.log every few days.