Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Class 'Piwik\Plugins\Provider\Provider' not found in plugins/UserCountry/Columns/Country.php:115 #18505

Closed
mig5 opened this issue Dec 14, 2021 · 7 comments
Labels
answered For when a question was asked and we referred to forum or answered it. Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.

Comments

@mig5
Copy link

mig5 commented Dec 14, 2021

I upgraded from 4.6.0 to 4.6.2, and for the first time ever, I got this fatal error in Matomo after a POST request to the piwik.php tracker came in via one of my sites:

PHP Fatal error:  Uncaught Error: Class 'Piwik\Plugins\Provider\Provider' not found in /var/www/piwik_4.6.2/plugins/UserCountry/Columns/Country.php:115#012St
ack trace:#012#0 /var/www/piwik_4.6.2/plugins/UserCountry/Columns/Country.php(99): Piwik\Plugins\UserCountry\Columns\Country->getCountryUsingProviderExtensionIfValid('xx.xx.xx.xx')#012#1 /v
ar/www/piwik_4.6.2/core/Tracker/Visit.php(514): Piwik\Plugins\UserCountry\Columns\Country->onNewVisit(Object(Piwik\Tracker\Request), Object(Piwik\Tracker\Visitor), Object(Piwik\Tracker\Actio
nPageview))#012#2 /var/www/piwik_4.6.2/core/Tracker/Visit.php(317): Piwik\Tracker\Visit->triggerHookOnDimensions(Array, 'onNewVisit')#012#3 /var/www/piwik_4.6.2/core/Tracker/Visit.php(210): 
Piwik\Tracker\Visit->handleNewVisit(NULL)#012#4 /var/www/piwik_4.6.2/core/Tracker.php(160): Piwik\Tracker\Visit->handle()#012#5 /var/www/piwik_4.6.2/core/Tracker/Handler.php(55): Piwik\Track
er->trackRequest(Object(Piwik\Tracker\Request))#012#6 /var/www/piwik_4.6.2/core/Tracker.php(140): Piwik\Tracker\Handler->process(Object(Piwik\Tracker in /var/www/piwik_4.6.2/plugins/UserCoun
try/Columns/Country.php on line 115

The POST request that came in from one of my sites (and got the 500 internal server due to the error above) looked like this:

xx.xx.xx.xx - - [14/Dec/2021:22:47:22 +0000] "POST /piwik.php?action_name=Home%20%E2%80%94%20Corporate&idsite=2&rec=1&r=259287&h=21&m=2&s=59&url=https%3A%2F%2Fxxxxxx.org%2F&urlref=https%3A%2F%2Fwww.google.com%2F&_id=9a3e0e3361e6d093&_idn=1&_refts=1636941779&_ref=https%3A%2F%2Fwww.google.com%2F&send_image=0&pdf=1&qt=0&realp=0&wma=0&fla=0&java=0&ag=0&cookie=1&res=1366x768&pv_id=OFW1Dt&pf_net=0&pf_srv=2&pf_tfr=4&pf_dm1=775 HTTP/1.1" 500 4541 "https://xxxxxx.org/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"

I have only masked the IP address and the website.

Expected Behavior

No errors - never had this one before

Current Behavior

As above

Your Environment

  • Matomo Version: 4.6.2
  • PHP Version: PHP 7.2.34-28+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Nov 19 2021 06:36:36) ( NTS )
  • Server Operating System: Ubuntu 18.04 LTS
@mig5 mig5 added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Dec 14, 2021
@sgiehl
Copy link
Member

sgiehl commented Dec 15, 2021

Hi @mig5. How did you perform the update? Using the autoupdate or did you remove / reupload the files? It seems the Provider plugin doesn't exist anymore even though it seems to be marked as installed.

@mig5
Copy link
Author

mig5 commented Dec 15, 2021

@sgiehl I replaced the entire codebase with the 4.6.2 tarball from https://builds.piwik.org/piwik-4.6.2.tar.gz, and put just the config.ini.php back in place from the original codebase I was on.

There is indeed no such 'Provider' plugin as far as I can tell, in the 4.6.1 or 4.6.2 releases. Yet there was in the 4.6.0 release.

user@example:~/piwik/piwik-4.6.0$ find . -type d -name Provider
./plugins/Provider
./core/Intl/Data/Provider
user@example:~/piwik/piwik-4.6.2$ find . -type d -name Provider
./core/Intl/Data/Provider

I now see in the changelog for 4.6.1 #17973 .

So, I think I've found you your bug. You removed a plugin but you have another plugin that still depends on it.

user@example:~/piwik/piwik-4.6.2$ grep -r "Provider\Provider" *
plugins/UserCountry/Columns/Country.php:use Piwik\Plugins\Provider\Provider as ProviderProvider;
plugins/UserCountry/Columns/Country.php:        $hostnameExtension = ProviderProvider::getCleanHostname($hostname);

@mig5 mig5 closed this as completed Dec 15, 2021
@mig5 mig5 reopened this Dec 15, 2021
@sgiehl
Copy link
Member

sgiehl commented Dec 15, 2021

It does a check if the plugin is installed before using it. But that check only looks if the plugin is listed in the installed plugin section of your config.ini.php.
If you remove it from this list the problem should be fixed for you

@mig5
Copy link
Author

mig5 commented Dec 15, 2021

Or is it that I'm meant to disable that plugin in the config now?

@mig5
Copy link
Author

mig5 commented Dec 15, 2021

Snap. OK thanks :)

@mig5 mig5 closed this as completed Dec 15, 2021
@justinvelluppillai justinvelluppillai added the answered For when a question was asked and we referred to forum or answered it. label Feb 1, 2022
@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/geolocation-causing-oops-message-after-upgrade/46647/4

@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/invalid-origin-error-matomo-4-10-1-on-iis/46617/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.
Projects
None yet
Development

No branches or pull requests

4 participants