Question

Magento started throwing errors yesterday, for no appearant reason. No change have been made to the files and nothing has been added to the site. Any advice? The magento version is 1.4 I have included the error log below.

Thanks

Error Log

a:4:{i:0;s:70:"Mage registry key "_singleton/aitsys/rewriter_observer" already exists";i:1;s:2732:"#0 /home/solarcon/public_html/shop/app/Mage.php(192): Mage::throwException('Mage registry k...')
#1 /home/solarcon/public_html/shop/app/Mage.php(446): Mage::register('_singleton/aits...', false)
#2 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/App.php(1209): Mage::getSingleton('aitsys/rewriter...')
#3 /home/solarcon/public_html/shop/app/Mage.php(416): Mage_Core_Model_App->dispatchEvent('resource_get_ta...', Array)
#4 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Resource.php(167): Mage::dispatchEvent('resource_get_ta...', Array)
#5 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(265): Mage_Core_Model_Resource->getTableName('core/store_grou...')
#6 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(247): Mage_Core_Model_Mysql4_Abstract->getTable('store_group')
#7 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php(137): Mage_Core_Model_Mysql4_Abstract->getMainTable()
#8 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php(174): Mage_Core_Model_Mysql4_Collection_Abstract->getMainTable()
#9 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php(117): Mage_Core_Model_Mysql4_Collection_Abstract->_initSelect()
#10 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Config.php(1208): Mage_Core_Model_Mysql4_Collection_Abstract->__construct(Object(Mage_Core_Model_Mysql4_Store_Group))
#11 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Config.php(1241): Mage_Core_Model_Config->getModelInstance('core_mysql4/sto...', Object(Mage_Core_Model_Mysql4_Store_Group))
#12 /home/solarcon/public_html/shop/app/Mage.php(460): Mage_Core_Model_Config->getResourceModelInstance('core/store_grou...', Object(Mage_Core_Model_Mysql4_Store_Group))
#13 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/store_grou...', Object(Mage_Core_Model_Mysql4_Store_Group))
#14 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#15 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/App.php(536): Mage_Core_Model_Abstract->getCollection()
#16 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/App.php(393): Mage_Core_Model_App->_initStores()
#17 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/App.php(299): Mage_Core_Model_App->_initCurrentStore('', 'store')
#18 /home/solarcon/public_html/shop/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#19 /home/solarcon/public_html/shop/index.php(80): Mage::run('', 'store')
#20 {main}";s:3:"url";s:59:"/shop/specials/enphase-ac-extension-cable-12-feet-d380.html";s:11:"script_name";s:15:"/shop/index.php";}
Was it helpful?

Solution

First, I'd throw away your assumptions about "nothing has changed". Due to Magento's various caches, it can be hours, or even days before a new code/configuration deployment actually shows an effect on the system.

Second, you're using a very out of date version of Magento. This fact often coincides with a very "altered from it's default state" Magento. This means there may not be a general answer to your problem, and only a developer investigating your exact system will be able to solve your problem.

Looking at your call stack, it appears when the resource_get_tablename event fires

#3 /home/solarcon/public_html/shop/app/Mage.php(416): Mage_Core_Model_App->dispatchEvent('resource_get_ta...', Array)

that there's an observer configured configured with a model name that starts with aitsys/rewriter... (PHP cuts off the full alias name).

#2 /home/solarcon/public_html/shop/app/code/core/Mage/Core/Model/App.php(1209): Mage::getSingleton('aitsys/rewriter...')

Whenever Magento instantiates a singleton event observer (or any singleton model), it adds it to the registry, with a call to Mage::register.

#1 /home/solarcon/public_html/shop/app/Mage.php(446): Mage::register('_singleton/aits...', false)

However, with your system, Magento thinks there's already an entry in the registry for that model/keyname

Mage registry key "_singleton/aitsys/rewriter_observer" already exists

HOWEVER, in a stock Magento system, this should never happen, as getSingleton checks the registry before trying to instantiate a model

public static function getSingleton($modelClass='', array $arguments=array())
{
    $registryKey = '_singleton/'.$modelClass;
    if (!self::registry($registryKey)) {
        self::register($registryKey, self::getModel($modelClass, $arguments));
    }
    return self::registry($registryKey);
}

This leads me to believe your core system has been altered. Also, the name of the observer model (aitsys/rewriter_observer) comes from a well known (if notorious) extension provider named AITOC. They're notorious because they altered your code Magento system to implement some systems of their own, including their DRM-ish licensing system. Given it's their extension causing this problem, you might have some luck reaching out to their support personal.

Given all that, it's doubtful someone will be able to come up with an answer here. Hopefully the above information will help you (or your developer) debug this themselves.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top