Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error: Class 'Piwik_UserCountry_LocationProvider' not found #3452

Closed
anonymous-piwik-user opened this Issue · 9 comments

3 participants

Anonymous Piwik user Benaka Matthieu Aubry
Anonymous Piwik user

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 Piwik user

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 Piwik user

Phoenix,

That seems to have solved the issue here as well.

Thank you

Anonymous Piwik user

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]
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

Benaka
Collaborator

(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 Piwik user

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,

Matthieu Aubry
Owner

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 Piwik user

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 Piwik user

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.

Benaka
Collaborator

@hass

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.