Opened 18 months ago

Closed 6 months ago

#3452 closed Bug (fixed)

Error: Class 'Piwik_UserCountry_LocationProvider' not found

Reported by: tgrondin Owned by: capedfuzz
Priority: critical Milestone: 1.9.1 - Piwik 1.9.1
Component: Core Keywords:
Cc: Sensitive: no

Description

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?

Change History (12)

comment:1 Changed 18 months ago by phoenix

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.

comment:2 Changed 18 months ago by tgrondin

Phoenix,

That seems to have solved the issue here as well.

Thank you

comment:3 Changed 18 months ago by tgrondin

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

comment:4 Changed 18 months ago by matt (mattab)

  • Milestone set to 1.9.1 - Piwik 1.9.1
  • Priority changed from normal to critical
  • Summary changed from Piwik 1.9 not tracking. to Error: Class 'Piwik_UserCountry_LocationProvider' not found

comment:5 Changed 18 months ago by matt (mattab)

  • Milestone changed from 1.9.2 - Piwik 1.9.2 to 1.9.1 - Piwik 1.9.1
  • Owner set to capedfuzz

comment:6 Changed 18 months ago by capedfuzz (diosmosis)

  • Resolution set to fixed
  • Status changed from new to closed

(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.

comment:7 Changed 6 months ago by hass

  • Resolution fixed deleted
  • Status changed from closed to reopened

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,

comment:8 Changed 6 months ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:9 Changed 6 months ago by hass

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:10 Changed 6 months ago by matt (mattab)

  • Resolution set to answered
  • Status changed from reopened to closed

comment:11 Changed 6 months ago by hass

  • Resolution answered deleted
  • Status changed from closed to reopened

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.

Last edited 6 months ago by hass (previous) (diff)

comment:12 Changed 6 months ago by capedfuzz (diosmosis)

  • Resolution set to fixed
  • Status changed from reopened to closed

@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.

Note: See TracTickets for help on using tickets.