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

PIwik 3.0.0 Core Plugin “UserCountry” Error #11057

Closed
rost-christian opened this issue Dec 21, 2016 · 10 comments
Closed

PIwik 3.0.0 Core Plugin “UserCountry” Error #11057

rost-christian opened this issue Dec 21, 2016 · 10 comments
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@rost-christian
Copy link

rost-christian commented Dec 21, 2016

Hi,

I use:
Piwik Version: 3.0.0
MySQL Version: 5.5.53
PHP-Version: 5.6.29-0+deb8u1

After I upgrade Piwik to v3.0.0, I get some errors.

I have to disable the Core Plugin "UserCountry" because, if i activate this Plugin, Piwik stops the tracking.

When the Plugin is activated, in the php Error Log I get the Error:

PHP Fatal error: Cannot redeclare class Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider in [...]/piwik/plugins/UserCountry/LocationProvider/Default.php on line 0

So, I have to deactivate the Plugin. With that, Piwik is tracking the website user. Without that, if the plugin is active, Piwik determines the tracking of the website User.

Also, if the UserCountry Plugin is activated, I can't access the following pages in Piwik:

  • Administration > Geolocation
  • Administration > Systemcheck

I only got a blank page.

FYI:
since the Update, I also get this PHP Error Message sometimes:

PHP Fatal error: Call to undefined method Piwik\Plugins\CorePluginsAdmin\CorePluginsAdmin::isMarketplaceEnabled() in [...]/piwik/plugins/CorePluginsAdmin/Tasks.php on line 1

PS:
Piwik 3.0.0 works only, when I uncomment in all .htaccess Files the last line:
#Options -Indexes
Without that, I can't see anything at the pages.

@mathomp4
Copy link

I am also seeing this same error on my newly update Piwik 3.0.0 instance and can confirm I can see the System Check again with UserCountry (and UserCountryMap) plugins disabled.

As I'm not really a power user of Piwik, all I can really add is: I miss the map. :)

@tsteur
Copy link
Member

tsteur commented Dec 21, 2016

For the IsMarketplaceEnabled problem please delete the file piwik/plugins/CorePluginsAdmin/Tasks.php. It should not be there anymore.

For redeclare class maybe have a look at #10378 . Does this help?

@mathomp4
Copy link

@tsteur, as I've said, I'm not a web guru or anything (mainly a Fortran programmer), but I took a look at #10378 and as near as I can tell, my php instance has OPcache enabled, but xcache is not. So I'm not hitting that. (Well, as far as I can decode Dreamhost and my phpinfo page.)

I guess the next question is how do I know if there is another cacher on? I see in my global.ini.php file that there is a [Cache] section, and backend is set to "chained". Should I fiddle with that? Or with RedisCache? (I looked in config.ini.php and I saw no cache in that file at all.)

@rost-christian
Copy link
Author

@tsteur
Thank you! Deleting the file
piwik/plugins/CorePluginsAdmin/Tasks.php
solves the "IsMarketplaceEnabled" Problem.

No, the #10378 doesn't fix my UserCountry Problem. I only use opcache.

But I have had a look at the piwik files at github and I saw that here at github is no file like
/piwik/plugins/UserCountry/LocationProvider/Default.php

So, I delete this file also and my problems are fixed now.

Thank you very very much for your help!
Greetz

@mathomp4
Copy link

Ah. Yup. That gets rid of the error for me too. I'm wondering if the upgrade to 3.0.0 also should require a find command to remove files that are old and no longer part of Piwik?

Also, my Country Map doesn't seem to be working at the moment (stuck at loading map) but it might be one of those "Wait 24 hours" things?

@tsteur
Copy link
Member

tsteur commented Dec 22, 2016

Piwik automatically deletes no longer needed files usually but there may be problems when there are no write permissions for Piwik to delete the files. In this case we would need to ideally show a list of commands after installation so users can copy paste and delete it.

Re the map and the redeclare class feature it is hard to tell without being able to debug on the server. Maybe you can give us access to your server and to Piwik?

@rost-christian
Copy link
Author

@tsteur
In my case, I update Piwik manually. I can't update it automatically because I have many Website in Piwik and it's better for me to update manually to avoid Errors.

When I do the update, I download the latest piwik.zip and unzip it directly on the Server. But If I only unzip the new files, the old wouldn't deleted. I don't know If Piwik would delete the old files, when I make the update over the Piwik Backend automatically, but this is no way for me.

But now, I knew that there can be problems after update Piwik manually, if there are old files in the Piwik directories and that I have to check it after every update. And if there are problems, I have to compare the files on my server with the files at github.

@mathomp4
Wait a little bit. But I think that you can already see some data at the County Map now.

@mattab
Copy link
Member

mattab commented Dec 26, 2016

At some point we'll make the System check display all files that are there but should be deleted: #11087

@mathomp4
Copy link

@Chriz1083 Well, I eventually got the maps working. I'm not sure how, but I guess just clicking buttons and turning things on and off works. shrug

@mattab That sounds great, especially as I upgrade with the unzip method on your site. I'm guessing it's not quite as robust during big updates like 2->3. My install is pretty boring so I'm guessing I could do a diff between piwik.zip expanded and my current install and figure out what is old and unneeded...but an automatic tool would be great!

@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Jan 9, 2017
@MatomoForumNotifications

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

https://forum.matomo.org/t/cannot-declare-class-piwik-plugins/49153/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

5 participants