Jump to content
  • 0

500 error with just one client ID


Qurius

Question

I've just started to get a 500 error on just one client in the client area.  I'm not using geoip but also get the same error when I go into geoip in settings.

With error logging enabled I get this when clicking on the client ID:

"Uncaught Error, code 0 in /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php on line 38 Message: Call to undefined function Blesta\Core\Util\GeoIp\geoip_open()"

Can someone give me some direction on where to start looking...

Thanks

Belsta 5.2.2

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0
21 hours ago, Qurius said:

I've just started to get a 500 error on just one client in the client area.  I'm not using geoip but also get the same error when I go into geoip in settings.

With error logging enabled I get this when clicking on the client ID:

"Uncaught Error, code 0 in /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php on line 38 Message: Call to undefined function Blesta\Core\Util\GeoIp\geoip_open()"

Can someone give me some direction on where to start looking...

Thanks

Belsta 5.2.2

Do you have GeoIP enabled under Settings > System > General > GeoIP Settings? If you upgraded from an earlier version that had the legacy version of MaxMind GeoIP, you must DELETE the original GeoIP data file and upload a new one. 

Link to comment
Share on other sites

  • 0
6 minutes ago, Qurius said:

I've never used/enabled GeoIP and get the same 500 error when going into Settings>System>General>GeoIP . 

Do you have errorReporting or debugging enabled in your /config/blesta.php config file? What version of PHP are you running? Is this a fresh 5.2.2 install or did you upgrade from an earlier version? If you upgraded, what version did you first install?

Link to comment
Share on other sites

  • 0
46 minutes ago, Qurius said:

The error I posted is what I get when errorReporting is enabled in /config/blesta.php. Running PHP 7.4 and 5.2.2 was an upgrade from a 4.x version. Oddly did not have this issue initially after upgrading so not sure why now. 

What happens when errorReporting is 0 and debugging is false in /config/blesta.php? Does it still produce a 500 error?

There is a possibility that some files may be missing. Sometimes they get skipped when uploading, I would try re-uploading the files from zip, overwriting the existing just to be sure everything is there. If your FTP program lists all the files, make there were no errors uploading.

Link to comment
Share on other sites

  • 0

When errorReporting is 0 it goes to the 500 error. When errorReporting is enabled it displays "Uncaught Error, code 0 in /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php on line 38 Message: Call to undefined function Blesta\Core\Util\GeoIp\geoip_open()"

Actually when checking some of the other clients I discovered several produce the error but not all.

I didn't see any errors when uploading to do the 5.2.2 upgrade but will do it again just to be sure nothing got missed.

 

I'll let you know if it helps...Thanks

Link to comment
Share on other sites

  • 0
3 minutes ago, Qurius said:

When errorReporting is 0 it goes to the 500 error. When errorReporting is enabled it displays "Uncaught Error, code 0 in /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php on line 38 Message: Call to undefined function Blesta\Core\Util\GeoIp\geoip_open()"

Actually when checking some of the other clients I discovered several produce the error but not all.

I didn't see any errors when uploading to do the 5.2.2 upgrade but will do it again just to be sure nothing got missed.

 

I'll let you know if it helps...Thanks

If that doesn't work, you might try enabling GeoIP and see if that gets rid of the error. To do that you'd need a free MaxMind account to download the data file though.

Link to comment
Share on other sites

  • 0
5 minutes ago, Qurius said:

That's one of the problems since going into GeoIP settings produces the error. What folder should the MaxMind db get uploaded to.

It would be located at ~/uploads/system/GeoLite2-City.mmdb whatever the path to your uploads directory is. If you have access to the database, you can also check to make sure it's not enabled. Here's the query to run to check:

SELECT * FROM `settings` WHERE `key`="geoip_enabled";

settings.value would be false for disabled, and true for enabled. If it is true, change it to false to disable it

Link to comment
Share on other sites

  • 0

Some progress...GeoIP was enabled in the database and disabling fixed the issue with opening the clients. However I am still getting a 500 error when going into GeoIP settings and with errorReporting enabled this is the error:

"Uncaught Error, code 0 in /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php on line 38 Message: Call to undefined function Blesta\Core\Util\GeoIp\geoip_open()"

I had uploaded GeoLite2-City.mmdb to ~/uploads/system/  and also uploaded 5.2.2 again with no failed transfer errors.

 

 

Link to comment
Share on other sites

  • 0

Interesting. I'm not able to reproduce this.

So you have the .mmdb file in the right location, and the database shows that geoip_enabled is true and the settings page for GeoIP at ~/admin/settings/system/general/geoip/ still throws an error?

Check if GeoIP is actually working. Go to a client's profile page, hover over their IP address on the left next to "Last seen". Does it show their location in the a tooltip?

Are there any other errors written to the log file ../logs_blesta/ (full path defined under Settings > System > General) when you reload the GeoIP settings page?

Link to comment
Share on other sites

  • 0

"So you have the .mmdb file in the right location, and the database shows that geoip_enabled is true and the settings page for GeoIP at ~/admin/settings/system/general/geoip/ still throws an error?"

The database was showing that GeoIP was enabled and I disabled it. Disabling it fixed the issue with the error when viewing the clients but did not fix the issue with accessing the GeoIP settings page .

"Check if GeoIP is actually working. Go to a client's profile page, hover over their IP address on the left next to "Last seen". Does it show their location in the a tooltip?"

The tooltip only shows their last activity not location.

"Are there any other errors written to the log file ../logs_blesta/ (full path defined under Settings > System > General) when you reload the GeoIP settings page?"

In logs_blesta this is generated when accessing the GeoIP settings page:

general.ERROR: Uncaught Exception Error: "Call to undefined function Blesta\Core\Util\GeoIp\geoip_open()" at /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php line 38 {"exception":"[object] (Error(code: 0): Call to undefined function Blesta\\Core\\Util\\GeoIp\\geoip_open() at /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php:38)"} 

 

Link to comment
Share on other sites

  • 0
15 hours ago, Qurius said:

"So you have the .mmdb file in the right location, and the database shows that geoip_enabled is true and the settings page for GeoIP at ~/admin/settings/system/general/geoip/ still throws an error?"

The database was showing that GeoIP was enabled and I disabled it. Disabling it fixed the issue with the error when viewing the clients but did not fix the issue with accessing the GeoIP settings page .

"Check if GeoIP is actually working. Go to a client's profile page, hover over their IP address on the left next to "Last seen". Does it show their location in the a tooltip?"

The tooltip only shows their last activity not location.

"Are there any other errors written to the log file ../logs_blesta/ (full path defined under Settings > System > General) when you reload the GeoIP settings page?"

In logs_blesta this is generated when accessing the GeoIP settings page:

general.ERROR: Uncaught Exception Error: "Call to undefined function Blesta\Core\Util\GeoIp\geoip_open()" at /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php line 38 {"exception":"[object] (Error(code: 0): Call to undefined function Blesta\\Core\\Util\\GeoIp\\geoip_open() at /home/account/public_html/clients/core/Util/GeoIp/GeoIp.php:38)"} 

 

This function geoip_open() is no longer used, it shouldn't be called. What could cause it to be called is if you have a copy of the OLD maxmind GeoIP file.

What files do you have in your ~/uploads/system/ directory? If there is an old version of the GeoIP data (Not the one ending in .mmdb but one ending in .dat, it will try to call this function. The file should be removed.

Link to comment
Share on other sites

  • 0

Thanks Paul -

Pilot error...when I checked the uploads directory in Settings> System > General earlier it looked correct ending in uploads/ . The fields visual portion was truncating the full path and it actually had /system added to it.  Sorry, I feel stupid for not fully double checking that earlier. 

Thanks again for your help

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...