Website Privilige Exception after Update to 1.10.1


after the update to the current Version 1.10.1 some customer of us have some login issues. They’ll get the following

The requested website idSite is not found in the request, or is invalid. Please check that you are logged in Piwik and have permission to access the specified website.

Go to Piwik

#0 /var/www/ Piwik_Controller->setGeneralVariablesView(Object(Piwik_View))
#1 /var/www/ Piwik_CoreHome_Controller->getDefaultIndexView()
#2 [internal function]: Piwik_CoreHome_Controller->index()
#3 /var/www/ call_user_func_array(Array, Array)
#4 /var/www/ Piwik_FrontController->dispatch()
#5 {main}

I’ve searched the net and found that the login would be wrong if this message occurs but the login is valid!
I created a new account with similar permissions and the new account is working ok.
I copied the piwik_user_dashboard settings from the new account to the old account but it didn’t work. Same message.
If I change the idsite in url(old login) it will work but if I try the settings dialog I’ll get the following and a login dialog

Fehler: Sie können auf diese Ressource nicht zugreifen, da es mindestens 'view'-Rechte für die Webseiten-ID 2 benötigt.
#0 /var/www/ Piwik_Access->checkUserHasViewAccess(2) 
#1 /var/www/ Piwik::checkUserHasViewAccess(2)
#2 /var/www/ Piwik_SitesManager_API->getSiteFromId(2) 
#3 /var/www/ Piwik_Site::getFor('2', 'name') 
#4 /var/www/ Piwik_Site::getNameFor('2') 
#5 [internal function]: Piwik_UsersManager_Controller->userSettings() 
#6 /var/www/ call_user_func_array(Array, Array) 
#7 /var/www/ Piwik_FrontController->dispatch() 
#8 {main}

the settings dialog with the new account works!

can anybody help?

Anyone an Idea?

please contact: for help as nobody else reported this message so require some look in your DB

i have the same problem…

New Piwik new try

Thats the thought.
Said done.

Error the same surprisingly without the backtrace.
It seems that the redirect after the login took the wrong site id and the legimite error occurs because the user does not have access on the site. So the question is where does piwik get the information from where to redirect a user after a successful login.

Any Ideas?

Does the user have access to the idSite they are redirected to? Can you guys please check that?

Nope the user only has view permissions to siteId 20 but is redirected to siteId 2

where is this setting stored to where to redirect?

Stored in the piwik_option table in the database. There should be an entry with open_name _defaultReport and the option_value is the site id.

Works exzellent!

Thanks for help


I had the same issue, only for one username, no changes were made, but for some reason it did now point to ID 1 instead of 4. The user reported he can not login after being able to login for several months prior. Is this a bug or something that should be checked? It took me almost an hour to figure this out. Thanks for the fix here but just strange that this happened.

I use Piwik 1.11.1

Best wishes,

Hi Thom,

that’s very surprising, if few users have experienced it maybe there is a way for some code to update this setting unexpectedly. If you can somehow reproduce this, let us know, as I’d love to fix it

Hi Matt,

I will monitor it, I am not sure why it happened, a user reported he can not login. I did sheck and saw that all is fine and he had right permissions for this particular account which is ID4. Then after seyng this post and checking the piwik_option table I saw it was assigned to ID1. I changed to ID4 in the table and all was OK.
I will see if it happens again, thank yoiu for replying.