@mig5 opened this Issue on December 14th 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<a href='/012'>#012</a>St
ack trace:<a href='/012'>#012</a><a href='/0'>#0</a> /var/www/piwik_4.6.2/plugins/UserCountry/Columns/Country.php(99): Piwik\Plugins\UserCountry\Columns\Country->getCountryUsingProviderExtensionIfValid('xx.xx.xx.xx')<a href='/012'>#012</a><a href='/1'>#1</a> /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))<a href='/012'>#012</a><a href='/2'>#2</a> /var/www/piwik_4.6.2/core/Tracker/Visit.php(317): Piwik\Tracker\Visit->triggerHookOnDimensions(Array, 'onNewVisit')<a href='/012'>#012</a><a href='/3'>#3</a> /var/www/piwik_4.6.2/core/Tracker/Visit.php(210): 
Piwik\Tracker\Visit->handleNewVisit(NULL)<a href='/012'>#012</a><a href='/4'>#4</a> /var/www/piwik_4.6.2/core/Tracker.php(160): Piwik\Tracker\Visit->handle()<a href='/012'>#012</a><a href='/5'>#5</a> /var/www/piwik_4.6.2/core/Tracker/Handler.php(55): Piwik\Track
er->trackRequest(Object(Piwik\Tracker\Request))<a href='/012'>#012</a><a href='/6'>#6</a> /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
@sgiehl commented on December 15th 2021 Member

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 commented on December 15th 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<a class='mention' href='https://github.com/example'>@example</a>:~/piwik/piwik-4.6.0$ find . -type d -name Provider
./plugins/Provider
./core/Intl/Data/Provider
user<a class='mention' href='https://github.com/example'>@example</a>:~/piwik/piwik-4.6.2$ find . -type d -name Provider
./core/Intl/Data/Provider

I now see in the changelog for 4.6.1 https://github.com/matomo-org/matomo/issues/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<a class='mention' href='https://github.com/example'>@example</a>:~/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);
@sgiehl commented on December 15th 2021 Member

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 commented on December 15th 2021

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

@mig5 commented on December 15th 2021

Snap. OK thanks :)

@MatomoForumNotifications commented on October 13th 2022

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 commented on October 13th 2022

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

This Issue was closed on December 15th 2021
Powered by GitHub Issue Mirror