Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

exception ‘Mage_Core_Exception’ with message ‘Invalid block type: ‘
 
johnny_n
Jr. Member
 
Total Posts:  13
Joined:  2012-06-12
 

I’ve been seeing this error since enabling logging—I’ve done a fair amount of research, including this one—http://www.magentocommerce.com/boards/v/viewthread/281275/ --but this one isn’t as clear—the block is empty and I can’t work out which file the error is in.  I’ve been through all the .xml files of extensions we’ve added and they all seem to be ok.

What could be causing this?  Using Magento 1.7.0.2.

2012-08-22T07:25:55+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'Invalid block type: ' in /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/Mage.php:594
Stack trace
:
#0 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
#2 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'checkout.cart')
#3 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'checkout.cart')
#4 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_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))
#5 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Checkout/controllers/CartController.php(159): Mage_Core_Controller_Varien_Action->loadLayout()
#9 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_CartController->indexAction()
#10 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#11 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#13 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#14 /home/XXXXXXXXXXXX/domains/XXXXXXXXXXXX/private_html/index.php(87): Mage::run('', 'store')
#15 {main}
this postthis post
 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

I see this text in the error ‘checkout.cart’
1. Try searching your layout files for this text and see what comes up.
2. Maybe you have some extension installed that should override the some checkout block and it fails. Try disabling extension one by one.
3. If none of the above work you can try to add in Mage_Core_Model_Layout this line:

Mage::log($_SERVER['REQUEST_URI']);
before any occurence of thes lines:
Mage::throwException(Mage::helper('core')->__('Invalid block type: %s'$block)); // you should find 2 occurences
//and
Mage::throwException(Mage::helper('core')->__('Invalid block type: %s'$type)); // - one occurence
Then check your logs again.
You should get an idea of what page does this so you can narrow your search area.
Good luck.
Marius.
 
Magento Community Magento Community
Magento Community
Magento Community
 
johnny_n
Jr. Member
 
Total Posts:  13
Joined:  2012-06-12
 

Thanks for the debug tip—it’s not really telling my anything new however:  /checkout/cart/

Since it’s not affecting the performance, I’m going to let it go.  Most likely it’s an extension I’ve added…

Thank you - great tip!  And nice blog by the way, I like your tips… wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Here is a strange/ funny story.
Yesterday afternoon I was looking through the code of a Magento Website trying to make a plan for an upgrade.
Among others I took a look in the exception.log file and I found this error:

exception 'Mage_Core_Exception' with message 'Invalid block type: ' in .....
....
#2 xxxxx/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'checkout.cart')
Looks familiar? smile
After investigating the layout files I found this in app/design/frontend/{interface}/{theme}/layout/local.xml
<block name="checkout.cart">
        <
remove name="checkout.cart.shipping"/>
</
block>
I’ve changed the section above to
<reference name="checkout.cart">
        <
remove name="checkout.cart.shipping"/>
</
reference>
and everything is OK now.
Unfortunately I don’t think this is an extension, maybe the guy that did the theme added this.
You can try searching in the layout files for something like this: ‘<block name="checkout.cart">’ maybe you find your problem.

Cheers,
Marius.

 
Magento Community Magento Community
Magento Community
Magento Community
 
johnny_n
Jr. Member
 
Total Posts:  13
Joined:  2012-06-12
 

Amazing… What are the odds of that!  wink

Thanks, Marius—that is a good suggestion.  I’ll look into it…

be well,
john.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dvincent
Jr. Member
 
Total Posts:  4
Joined:  2009-10-12
 

johnny_n,

I am having the exact same execption.log error message as you are--even down to the same exact php line numbers.

Were you ever able to resolve this issue?  My site appears to be working just fine, but I am anal and would really like to get rid of this error message!

I am also running on Magento CE 1.7.0.2

Thanks for any help!

Sincerely,
Don V.

 
Magento Community Magento Community
Magento Community
Magento Community
 
johnny_n
Jr. Member
 
Total Posts:  13
Joined:  2012-06-12
 

Hi dvincent, no, I didn’t to be honest.  Like you, my site seems to work just fine, and in the end I decided not to worry about it… I had a hunch it was going to take a bit to track down and figured I could better spend my time elsewhere.

If I do I will certainly post back…

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

You can try searching in the layout files of your theme for the text I suggested in the previous post.

<block name="checkout.cart">
and replace with
<reference name="checkout.cart">
That did the trick for me.

Marius.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GregC
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2007-11-23
A^2, MI
 

Just ran into this issue as well. In my case it was caused by moving code from a case insensitive environment (OSX) to a case sensitive one (Linux).  Once I fixed the file name casing, the problem was gone.

Check to make sure the first letter of directory and filenames are properly uppercased in modules.

Greg

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top