I just fixed my joomla (2.5.14) installation which denied backend access for all users except the super user. I don’t know since when exactly the error existed – some of the last few updates might have introduced it.

The authorization settings for the user groups seemed alright and the database check showed no errors but turning on system debugging (under site > configuration > system) revealed a SQL error during the login attempt:

500 - An error has occurred.
JDatabaseMySQL::query: 1054 - Unknown column 'alias' in 'where clause' SQL=SELECT id FROM j16_assets WHERE alias = 'root'

Call stack
#    Function    Location
1    JAdministrator->dispatch()    /web/1/000/045/668/175080/htdocs/myWebsite/administrator/index.php:46
2    JComponentHelper::renderComponent()    /web/1/000/045/668/175080/htdocs/myWebsite/administrator/includes/application.php:153
3    JComponentHelper::executeComponent()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/application/component/helper.php:351
4    require_once()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/application/component/helper.php:383
5    JController->execute()    /web/1/000/045/668/175080/htdocs/myWebsite/administrator/components/com_login/login.php:19
6    LoginController->login()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/application/component/controller.php:761
7    JAdministrator->login()    /web/1/000/045/668/175080/htdocs/myWebsite/administrator/components/com_login/controller.php:57
8    JApplication->login()    /web/1/000/045/668/175080/htdocs/myWebsite/administrator/includes/application.php:234
9    JApplication->triggerEvent()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/application/application.php:711
10    JDispatcher->trigger()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/application/application.php:642
11    JEvent->update()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/event/dispatcher.php:161
12    call_user_func_array()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/event/event.php:71
13    plgUserJoomla->onUserLogin()
14    JUser->authorise()    /web/1/000/045/668/175080/htdocs/myWebsite/plugins/user/joomla/joomla.php:148
15    JAccess::check()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/user/user.php:386
16    JTableNested->getRootId()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/access/access.php:103
17    JDatabase->loadColumn()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/database/tablenested.php:1262
18    JDatabaseMySQL->execute()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/database/database.php:965
19    JError::raiseError()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/database/database/mysql.php:548
20    JError::raise()    /web/1/000/045/668/175080/htdocs/myWebsite/libraries/joomla/error/error.php:251

This error seems to be triggered by a combination of a broken asset database table and a piece of unrobust Joomla code. A (closed) ticket describing the problem exists in the bugtracker, linking to the actual solution. A joomla docs article describes the steps necessary to recognise and fix a broken asset table.

Following these steps fixed my access denied error just fine but it was a lot of work – even for my small page. It’s a pity this kind of error is not covered by the joomla database check.