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
Login
Backtrace:
#0 /var/www/piwik.ibumedia.de/plugins/CoreHome/Controller.php(60): Piwik_Controller->setGeneralVariablesView(Object(Piwik_View))
#1 /var/www/piwik.ibumedia.de/plugins/CoreHome/Controller.php(95): Piwik_CoreHome_Controller->getDefaultIndexView()
#2 [internal function]: Piwik_CoreHome_Controller->index()
#3 /var/www/piwik.ibumedia.de/core/FrontController.php(138): call_user_func_array(Array, Array)
#4 /var/www/piwik.ibumedia.de/index.php(53): 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.ibumedia.de/core/Piwik.php(1916): Piwik_Access->checkUserHasViewAccess(2)
#1 /var/www/piwik.ibumedia.de/plugins/SitesManager/API.php(120): Piwik::checkUserHasViewAccess(2)
#2 /var/www/piwik.ibumedia.de/core/Site.php(262): Piwik_SitesManager_API->getSiteFromId(2)
#3 /var/www/piwik.ibumedia.de/core/Site.php(276): Piwik_Site::getFor('2', 'name')
#4 /var/www/piwik.ibumedia.de/plugins/UsersManager/Controller.php(158): Piwik_Site::getNameFor('2')
#5 [internal function]: Piwik_UsersManager_Controller->userSettings()
#6 /var/www/piwik.ibumedia.de/core/FrontController.php(138): call_user_func_array(Array, Array)
#7 /var/www/piwik.ibumedia.de/index.php(53): Piwik_FrontController->dispatch()
#8 {main}
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.
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.
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
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.