magneto-varnish icon indicating copy to clipboard operation
magneto-varnish copied to clipboard

Could not flush cache or do some change in backend.

Open kevin25 opened this issue 12 years ago • 6 comments

I got this erro when flushed the cache:

There has been an error processing your request

Mage registry key "_singleton/varnish/observer" already exists

Trace: #0 /var/www/html/app/Mage.php(192): Mage::throwException('Mage registry k...') #1 /var/www/html/app/Mage.php(446): Mage::register('_singleton/varn...', false) #2 /var/www/html/app/code/core/Mage/Core/Model/App.php(1208): Mage::getSingleton('varnish/observe...') #3 /var/www/html/app/Mage.php(416): Mage_Core_Model_App->dispatchEvent('http_response_s...', Array) #4 /var/www/html/app/code/core/Mage/Core/Controller/Response/Http.php(74): Mage::dispatchEvent('http_response_s...', Array) #5 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(188): Mage_Core_Controller_Response_Http->sendResponse() #6 /var/www/html/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch() #7 /var/www/html/app/Mage.php(596): Mage_Core_Model_App->run(Array) #8 /var/www/html/index.php(80): Mage::run('', 'store') #9 {main}

Also varnish cache cart and checkout. I am using magento 1.4.

Thanks

kevin25 avatar Nov 28 '12 08:11 kevin25

When i tried to uninstall it, it got this

Not enough arguments (no action specified)

kevin25 avatar Nov 28 '12 10:11 kevin25

It looks like the module was not properly installed, is not able to find the class of 'varnish/observer' and tries to store in registry false. Do you see any configs defined by module in admin? (checking if is properly installed)

madalinoprea avatar Nov 28 '12 11:11 madalinoprea

I installed it without error, but when i came to flush cache to activate the module, i got that error. And i could uninstall also.

kevin25 avatar Nov 28 '12 11:11 kevin25

It seems that Magento loaded module's config and registered the observer for http_response_send_before. But when it's trying to instantiate an object for varnish/observer uri (defined via the same config) has some problems.

An idea is to add some debugging code or use xdebug to identify the pace where you it goes crazy. Check Mage_Core_Model_Config, I would expect to see $className = 'Magneto_Varnish_Model_Observer' and class_exists failing.

public function getModelInstance($modelClass='', $constructArguments=array()) { $className = $this->getModelClassName($modelClass); if (class_exists($className)) {

I assume you're having a single server, the default cache backend (files), nothing uber fancy.

madalinoprea avatar Nov 28 '12 11:11 madalinoprea

Here it is public function getModelInstance($modelClass='', $constructArguments=array()) { $className = $this->getModelClassName($modelClass); if (class_exists($className)) { Varien_Profiler::start('CORE::create_object_of::'.$className); $obj = new $className($constructArguments); Varien_Profiler::stop('CORE::create_object_of::'.$className); return $obj; } else { #throw Mage::exception('Mage_Core', Mage::helper('core')->__('Model class does not exist: %s.', $modelClass)); return false; } }

kevin25 avatar Nov 28 '12 11:11 kevin25

Any idea? This is very urgent. Thanks!

kevin25 avatar Nov 28 '12 13:11 kevin25