0

Sites been slow and many people are unable to access to the site. The exception.logs been throwing up an an invalid block error and i cant find where this error is cropping up from. The error is mainly in the PRODUCT.INFO.UPSELL block and i tried searching through the layout xml files but i couldnt find anything. Can someone help please.

The error is as follows

    exception 'Mage_Core_Exception' with message 'Invalid block type: ' in /home/*******/public_html/app/Mage.php:595
/home/*******/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
/home/*******/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
/home/*******/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'product.info.up...')
/home/*******/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'product.info.up...')
/home/*******/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
/home/*******/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
/home/*******/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
/home/*******/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(73): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
/home/*******/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(144): Mage_Catalog_Helper_Product_View->initProductLayout(Object(Mage_Catalog_Model_Product), Object(Mage_Catalog_ProductController))
/home/*******/public_html/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(28, Object(Mage_Catalog_ProductController), Object(Varien_Object))
/home/*******/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_ProductController->viewAction()
/home/*******/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
/home/*******/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
/home/*******/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
/home/*******/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
/home/*******/p

I tried the following solution, https://stackoverflow.com/questions/21217215/magento-illegal-block-type which says - It looks like something to do with your upsell block on the product view page. Check your template files (catalog.xml) and ensure you have a block type set for the block definition with name product.info.upsell. To establish if this is where you error originates you could comment out the line getChildHtml('upsell_products'); ?> in view.phtml and the xml definitions for the block mentioned above.

So i went to the following destination on my magento installation -

/home/xxxxxxxxxx/public_html/app/design/frontend/megatron/default/template/catalog/product/view.phtml

and applied the above mentioned solution but still no success

5
  • Check first byte receive time By inspect in browser and which part time taking so much time clear cache and reindex Oct 8, 2016 at 14:46
  • Hey @lalitmohan thanks for replying. Will do that, but my main problem is the exception.log errors thats showing up
    – I rehman
    Oct 8, 2016 at 15:00
  • As per your error when Magento is loading the layout update xml files, and using them to create the blocks which will render the HTML for the page. Problem with addBlock , createBlock dispatch may be missing some syntax Oct 8, 2016 at 15:32
  • Check catalog.xml for layout syntax may be miss block type ,name or use <block type=""> instead of <reference name =""> Oct 8, 2016 at 15:44
  • @lalitmohan already tried that still no success
    – I rehman
    Oct 9, 2016 at 20:25

1 Answer 1

0

Try to edit app/code/core/Mage/Core/Model/Layout.php(495) and logging the block type that it's rendering. You can then try to figure out where this block is being inserted - it can be added from a layout xml file or it can be generated from php code.

However, unless your log file is huge, this probably isn't the cause for performance degradation. It's not ok to have this, but things should work fine with a bug like this.

PS - edit that file temporary, on a dev or stage env, not live

8
  • not much of success yet. Log file is growing like 1 mb every day. I get an exception every moment someones on the site.
    – I rehman
    Oct 9, 2016 at 20:55
  • does it happen anywhere or a specific page, like product page, category page, etc?
    – Cristi
    Oct 10, 2016 at 13:57
  • happens every 2 minutes or so. My reading is that it happens when someone logs on to the product page on the site.
    – I rehman
    Oct 11, 2016 at 18:50
  • i rechecked the exception trail, and it looks like the upsell block is introduced without a type. do you use any extensions for automatic upsell/related products? have you checked all layout xmls for typos? try linting them. looks like the error is coming from the xml's. ultimately, it could be from layout updates (per product), but it doesn't look like that.
    – Cristi
    Oct 12, 2016 at 9:19
  • Thanks a lot. I will check the layout xmls. can you advice me what i should be looking for ?
    – I rehman
    Oct 13, 2016 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.