When clicking on Magento Connect Manager from admin, facing this error: Mage registry key "_singleton/admin/session" already exists
Magento 1.9 Admin Panel – Fix ‘Mage Registry Key _singleton/admin/session Already Exists’
admin-panelmagento-1.9magento-connect
Related Topic
- Magento – Fix Mage Registry Key ‘_singleton/magenotification/observer’ Already Exists
- Magento – Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect) magento rest api error
- Magento – Mage registry key already exists Error
- Magento 1.9 – Fix ‘Mage Registry Key _singleton/mage_gextorshop/observer Already Exists’ Error
Best Answer
I don't have a solution, but I can explain why/when this is happening.
TL;DR: In your case the model
admin/session
is not instantiated or does not exist andMage::getModel('admin/session')
returns falseFull explanation
There is a bug (or better yet an inconsistency) in the
Mage::getSingleton
method.It has been there for ages.
The method looks like this:
Now let's take a look at the
Mage::register
methodNotice the
throwException
. It is exactly what you see as error message. If there is already a value in the registry for a certain key, you get an error.In your case you get this error because there is already a value for key
_singleton/admin/session
. This happens in one case.Going back to the
getSingleton
method, this is the bug/inconsistency:This condition will return
true
when the value you registered for a specific key isnull, false, 0
.This happens when
getModel
returnsfalse
. (when a model class is not found).You should check if you have extensions rewriting the admin session class, or you can debug starting from the methods above to see why you are getting this error.