@anonymous-matomo-user opened this Issue on October 17th 2012

A upgrade from 1.8.4 with the old GeoIP plugin enabled to the latest 1.9 throws this error when attempting to track.

PHP Fatal error: Class 'Piwik_UserCountry_LocationProvider' not found in /path/to/core/Tracker/Visit.php on line 609

I am assuming it's a geoip issue.

The upgrade was done by replacing the entire installation folder with the 1.9 files and copying the config/config.ini.php from the old install.

I removed the old GeoIP plugin from the config.ini.php. Then ran the sql update script. The new Geolocation configuration is set to use (GeoIP (PECL). The error occurs with any Geo location setting. The GeoIPCity.dat file is in the Misc/ folder.

The system does track for about 30 seconds if I delete the tmp folder. Piwik regenerates the tmp folder and then it starts throwing the above error again.

Any ideas?

@anonymous-matomo-user commented on October 17th 2012

I have the same problem. The plugin UserCountry is enabled and i have temporarly resolve the problem by adding the followed two lines in the script core/Tracker/Visit.php :

require_once PIWIK_INCLUDE_PATH . "/plugins/UserCountry/LocationProvider.php";
require_once PIWIK_INCLUDE_PATH . "/plugins/UserCountry/UserCountry.php";

I don't thing that this is the correct way to resolve the problem.

@anonymous-matomo-user commented on October 17th 2012


That seems to have solved the issue here as well.

Thank you

@anonymous-matomo-user commented on October 18th 2012

Phoenix, or anybody else interested. The issue seems to solve it's self if you are careful with the order in which the Tracker plugins are listed.

I changed mine to look like below as the last lines in the config/config.ini.php file.

Plugins_Tracker[] = "AnonymizeIP"
Plugins_Tracker[] = "DoNotTrack"
Plugins_Tracker[] = "Provider"
Plugins_Tracker[] = "UserCountry"
Plugins_Tracker[] = "GeoIP"
Plugins_Tracker[] = "Goals"

I am not sure if the above order is correct, but it appears to solve the issue for me.
Once done, I was able to take the two lines out of the Visit.php file and GeoIP is now recording information correctly.

As a side note, I imagine anybody who is doing manual configuration or multiple severs may run into this.

Thank you

@diosmosis commented on October 19th 2012 Member

(In [7237]) Fixes #3452, add UserCountry to Plugins_Tracker config and in order to avoid possible fatal error, moved UNKNOWN_CODE to Tracker_Visit and use 'country_code' instead of LocationProvider constant.

@anonymous-matomo-user commented on October 14th 2013

This bug seems not finally fixed. I have thousands of this in error log per day and server 500 errors. I'm using latest 1.12

PHP Fatal error: Class 'Piwik_UserCountry_LocationProvider' not found in /srv/aaa/bbb/html/piwik/core/Tracker/Visit.php on line 655,

@mattab commented on October 14th 2013 Member

please try with latest 2.0-a and reopen if you still have the issue in 2.0 http://builds.piwik.org/?C=N;O=D

@anonymous-matomo-user commented on October 14th 2013

I'm sorry, but I only use official releases and not alpha versions. Make a new release or point me to the bugfix case, please.

The issue reported here is not fixed in 1.12

@anonymous-matomo-user commented on October 23rd 2013

There is no answer.

I'm running 1.12 and the system is down. Upgrading to alpha versions is a joke. Are you crazy?

Let us know how this can ve fixed and when you release a 1.13 or 2.0 final with bugfix included. Also share a hotfix patch for 1.12, please.

@diosmosis commented on October 23rd 2013 Member


Try adding "UserCountry" to [Plugins_Tracker] in your config/config.ini.php file (as mentioned above). If that doesn't work, try adding

require_once PIWIK_INCLUDE_PATH . "/plugins/UserCountry/LocationProvider.php";
require_once PIWIK_INCLUDE_PATH . "/plugins/UserCountry/UserCountry.php";

to core/Tracker/Visit.php after the '<?php' line (also as mentioned above).

If neither of these solutions work, please use the forums for support: http://forum.piwik.org/. These tickets reference problems that exist in the current code on github (either on master or the 1.X branch). It is not appropriate to use trac as your personal helpdesk. Please do not reopen this ticket again.

This Issue was closed on October 23rd 2013
Powered by GitHub Issue Mirror