Admin user locked out after upgrade to 2.1

(Mack) #1

Title says it all. I ran the auto Piwik upgrade and can no longer access data. The error presented after logging in is :

You are logged in as ‘[admin_name]’ but it seems you don’t have any permission set in Piwik.
Ask your Piwik administrator (click to email) to give you ‘view’ access to a website.

Other users with view access still work, but the original admin user with access to all functionality [admin_name] does not exist in the piwik_access table. Traffic data is being recorded and is viewable by the other users, so it simply seems that the superadmin user has been corrupted.

I am also receiving emails indicating an error for each defined site when archive.php runs :

Response was ‘a:2:{s:6:“result”;s:5:“error”;s:7:“message”;s:86:“You can’t access this resource as it requires an ‘view’ access for the website id = 6.”;}’

Any advice will be greatly appreciated. Thanks.



Please, check my answer at: 301 Moved Permanently

Last part was the way i found to solve it.


(Mack) #3

Whew. It turns out that all I had to do was flip the piwik_user.superuser_access flag from 0 to 1 for my user account, and all is back to normal now. Not sure why it was changed during the upgrade, but figured I’d post here in case it might help others.

Thanks for the pointer, Hugo.


Nice…, i did lost my user, not sure why.

Glad you figured it out! :slight_smile:


I am a new PIWIK admin and just performed the upgrade to 2.0.1. I performed the database upgrade at commanline and the admin account no longer works. Actually it is not listed in the piwik_user table. What is the best way to get it back in place?


Hi Price,

I am facing the same issue. Did you fix it any how? If yes, please let me know how to resolve it.



Hey there.

You only have one user in the database?
If you have access with a view user, change that user in the database to super admin (you can use phpMyAdmin).
At the piwik_user table check the username you want to change, in the superuser_access column change from 0 to 1.

That user will be the superadmin now.

Hope that helps.



Hi Hugo,

Thanks for the quick response. It worked for us here.

I am able to successfully run PIWIK archiving but i am not able to see the Data for the last 3 days. I have upgraded 3 Days ago and now Data is not visible. Can you help me here?



Data is not visible only for that 3 days?
You getting data for today for example?

Before the upgrade did you enabled the piwik maintenance mode and disabled tracking?



Yes Hugo, we have enabled Maintenance Mode and did the upgrade. But we have few issues like Superuser locked out etc.

And also i am able to see today’s data but not those two particular days data.

Is there a way that we can get this data from MySQL DB? Do you have an idea about the table names and the queries for getting the below information for those missing dates in DB?

Unique visitors
Unique Pageviews



Hi Hugo,

Also i see below error when running archiving manually from command prompt.

D:\PHP>D:\PHP\php.exe “D:\Apache Software Foundation\Apache2.2\htdocs\piwik\misc
\cron\archive.php” – url=http://swa-pwkpw01.swas24prod.local/piwik/ --force-all
Zend_Session is currently marked as read-only.


(Matthieu Aubry) #12

please try with 2.2.0 versoin: 301 Moved Permanently