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

Page 1 of 2
Major error - site completely down
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

Fatal error: Call to a member function getAttributeCode() on a non-object in /home/-----/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line 336

On every page, even /admin, cannot get any further.  Seems like something happened with the EAVs...!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Silebis
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-01-15
Opava
 

i have same problems too :-(

in admin:

Fatal errorCall to a member function getBackend() on a non-object in /var/www/path/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line 379

in backend:

#0 /var/www/path/httpdocs/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(336): Mage::exception('Mage_Eav', 'Po??adovan?? ne...')
#1 /var/www/path/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php(233): Mage_Eav_Model_Entity_Collection_Abstract->addAttributeToSelect('name')
#2 /var/www/path/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php(201): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree->_getDefaultCollection(false)
#3 /var/www/path/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php(84): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree->getCollection(false)
#4 /var/www/path/httpdocs/app/code/core/Mage/Catalog/Helper/Category.php(76): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree->addCollectionData(NULL, false, '2', true, true)
#5 /var/www/path/httpdocs/app/code/core/Mage/Catalog/Block/Navigation.php(64): Mage_Catalog_Helper_Category->getStoreCategories()
#6 /var/www/path/httpdocs/app/design/frontend/default/modern/template/catalog/navigation/top.phtml(35): Mage_Catalog_Block_Navigation->getStoreCategories()
#7 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(144): include('/var/www/vhosts...')
#8 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#9 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#10 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#11 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#12 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Text_List->_toHtml()
#13 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#14 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('topMenu', true)
#15 /var/www/path/httpdocs/app/design/frontend/default/modern/template/page/html/header.phtml(30): Mage_Core_Block_Abstract->getChildHtml('topMenu')
#16 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(144): include('/var/www/vhosts...')
#17 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#18 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#19 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#20 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#21 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('header', true)
#22 /var/www/path/httpdocs/app/design/frontend/default/modern/template/page/3columns.phtml(47): Mage_Core_Block_Abstract->getChildHtml('header')
#23 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(144): include('/var/www/vhosts...')
#24 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(176): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#25 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Template.php(193): Mage_Core_Block_Template->renderView()
#26 /var/www/path/httpdocs/app/code/core/Mage/Core/Block/Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#27 /var/www/path/httpdocs/app/code/core/Mage/Core/Model/Layout.php(525): Mage_Core_Block_Abstract->toHtml()
#28 /var/www/path/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(326): Mage_Core_Model_Layout->getOutput()
#29 /var/www/path/httpdocs/app/code/core/Mage/Cms/Helper/Page.php(92): Mage_Core_Controller_Varien_Action->renderLayout()
#30 /var/www/path/httpdocs/app/code/core/Mage/Cms/controllers/IndexController.php(32): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#31 /var/www/path/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(349): Mage_Cms_IndexController->indexAction()
#32 /var/www/path/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(163): Mage_Core_Controller_Varien_Action->dispatch('index')
#33 /var/www/path/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(174): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#34 /var/www/path/httpdocs/app/Mage.php(447): Mage_Core_Controller_Varien_Front->dispatch()
#35 /var/www/path/httpdocs/index.php(46): Mage::run()
#36 {main}
 
Magento Community Magento Community
Magento Community
Magento Community
 
cannonballdex
Member
 
Avatar
Total Posts:  65
Joined:  2008-10-16
 

Try FTP clearing out your Cache Folder.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Silebis
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-01-15
Opava
 

of course, i tried, but error is still here

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

I have the same problem

While upgrades on some sites are fine, one site comes up with

Fatal error: Call to a member function getBackend() on a non-object in /var/www/kugan/pecco/www2/pecnew/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line 379

I have no ideas at this time except as mentioned it has something to do with EAV and it doesn’t like

Mage_Eav_Model_Entity_Collection_Abstract->addAttributeToSelect(’name’)

Invalid attribute requested: name

but this may be a false track.

edit:

It is possible to get into the admin section by firstly logging in which produces the error message but go to url like

/index.php/admin/cms_page/

I think now that one of the EAV database tables is corrupted!

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
clorne - 23 November 2008 01:59 AM

I think now that one of the EAV database tables is corrupted!

Yep, I’m thinking the same thing.  Luckily I made a backup so our site was only down for 30 minutes whilst we restored, but I’ve made a local copy and can’t seem to find the root of the problem.

I do think there’s a DB corruption.

Any word from Magento on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

My one site that crashed was pre-production so not too much of a problem except I did make a DB backup before doing upgrade, as well as trying it on a local machine, but when I restored the DB it still didn’t work presumably because changes had been made to the core. 

On production sites it would be wise to backup the entire site and the DB before upgrade!

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
clorne - 24 November 2008 12:16 AM

My one site that crashed was pre-production so not too much of a problem except I did make a DB backup before doing upgrade, as well as trying it on a local machine, but when I restored the DB it still didn’t work presumably because changes had been made to the core. 

On production sites it would be wise to backup the entire site and the DB before upgrade!

I did, thankfully, or we’d have lost days worth of trading!

I’ve just tried the update on a local copy of the site now, same problem, so I need to now fix the issue, whatever it is, as I don’t want to be stuck at 1.1.6 forever… =(

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

Here’s the full trace:

Invalid attribute requestedname
Trace
:
#0 C:\xampp\htdocs\magento\app\code\core\Mage\Eav\Model\Entity\Collection\Abstract.php(336): Mage::exception('Mage_Eav', 'Invalid attribu...')
#1 C:\xampp\htdocs\magento\app\code\core\Mage\Catalog\Model\Resource\Eav\Mysql4\Category\Tree.php(233): Mage_Eav_Model_Entity_Collection_Abstract->addAttributeToSelect('name')
#2 C:\xampp\htdocs\magento\app\code\core\Mage\Catalog\Model\Resource\Eav\Mysql4\Category\Tree.php(201): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree->_getDefaultCollection(false)
#3 C:\xampp\htdocs\magento\app\code\core\Mage\Catalog\Model\Resource\Eav\Mysql4\Category\Tree.php(84): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree->getCollection(false)
#4 C:\xampp\htdocs\magento\app\code\core\Mage\Catalog\Helper\Category.php(76): Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree->addCollectionData(NULL, false, '2', true, true)
#5 C:\xampp\htdocs\magento\app\code\local\Mage\Catalog\Block\Navigation.php(58): Mage_Catalog_Helper_Category->getStoreCategories()
#6 C:\xampp\htdocs\magento\app\design\frontend\default\---\template\catalog\navigation\top.phtml(29): Mage_Catalog_Block_Navigation->getStoreCategories()
#7 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(144): include('C:\xampp\htdocs...')
#8 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView('frontend\defaul...')
#9 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#10 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#11 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract->toHtml()
#12 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Text_List->_toHtml()
#13 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#14 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('topMenu', true)
#15 C:\xampp\htdocs\magento\app\design\frontend\default\---\template\page\html\header.phtml(49): Mage_Core_Block_Abstract->getChildHtml('topMenu')
#16 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(144): include('C:\xampp\htdocs...')
#17 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView('frontend\defaul...')
#18 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#19 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#20 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#21 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml('header', true)
#22 C:\xampp\htdocs\magento\app\design\frontend\default\---\template\page\1column.phtml(43): Mage_Core_Block_Abstract->getChildHtml('header')
#23 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(144): include('C:\xampp\htdocs...')
#24 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView('frontend\defaul...')
#25 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#26 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#27 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php(525): Mage_Core_Block_Abstract->toHtml()
#28 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(326): Mage_Core_Model_Layout->getOutput()
#29 C:\xampp\htdocs\magento\app\code\core\Mage\Cms\Helper\Page.php(92): Mage_Core_Controller_Varien_Action->renderLayout()
#30 C:\xampp\htdocs\magento\app\code\core\Mage\Cms\controllers\IndexController.php(32): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#31 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(349): Mage_Cms_IndexController->indexAction()
#32 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(163): Mage_Core_Controller_Varien_Action->dispatch('index')
#33 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(174): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#34 C:\xampp\htdocs\magento\app\Mage.php(447): Mage_Core_Controller_Varien_Front->dispatch()
#35 C:\xampp\htdocs\magento\index.php(34): Mage::run()
#36 {main}

It’s not a problem with any .phtml files, because I renamed the themed used so it used default, exact same error.  Must be in the database or the code PHP files.

If I run

SELECT *
FROM `eav_attribute`
WHERE `attribute_code` LIKE ‘name’
LIMIT 0 , 30

on both the (now proken) test site at 1.1.7 and the live site at 1.1.6 I get exactly the same recordset.  So it’s presumably the code, then?

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

I appreciate your dilemma.  I have had to start afresh using original theme but what is curious is that my local Windows test site was a mirror of the pre-production site but upgraded without a problem.  I couldn’t easily carry out the usual debugging processes so gave up.

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
clorne - 24 November 2008 12:47 AM

I appreciate your dilemma.  I have had to start afresh using original theme but what is curious is that my local Windows test site was a mirror of the pre-production site but upgraded without a problem.  I couldn’t easily carry out the usual debugging processes so gave up.

Unfortunately I don’t have that luxury, this needs to work on our current live site, we can’t start again!

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

OK, I think I’ve sorted out the problem.  Will test a bit more then let you know once I’m 100%

 
Magento Community Magento Community
Magento Community
Magento Community
 
mediagang
Sr. Member
 
Avatar
Total Posts:  111
Joined:  2008-01-16
Leeds UK
 

I also have the same error.  Clearing cache made no difference. hoping redpen has the answer…

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
mediagang - 24 November 2008 07:18 AM

I also have the same error.  Clearing cache made no difference. hoping redpen has the answer…

Right, try this:

Go into PHPMyAdmin, and find the eav_attribute table.  You’ll see a few fields that (in my case) had no values in for certain attributes, and I think they should be “NULL”.  These are:  attribute_model, backend_model, backend_table, frontend_model and source_model.

Use this SQL [ UPDATE eav_attribute SET source_model = NULL WHERE source_model = “” ] on each of those fields, obviously changing source_model in the SQL to the name of the table (note it’s in there twice).  Do this for all 5 fields, then refresh your Magento page.  It worked for me, but please let me know if it worked for you, took me about 6 hours to figure that out…

 
Magento Community Magento Community
Magento Community
Magento Community
 
mediagang
Sr. Member
 
Avatar
Total Posts:  111
Joined:  2008-01-16
Leeds UK
 

Worked a TREAT! Thanks very much Redpen smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
thetoine
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-06-04
Montreal, Canada
 

Awesome! I confirm, this is working. Here’s the 5 queries :

UPDATE eav_attribute SET attribute_model NULL WHERE attribute_model ''
UPDATE eav_attribute SET backend_model NULL WHERE backend_model ''
UPDATE eav_attribute SET backend_table NULL WHERE backend_table ''
UPDATE eav_attribute SET frontend_model NULL WHERE frontend_model ''
UPDATE eav_attribute SET source_model NULL WHERE source_model ''

Now I have another bug… in Categories… grrrr..! I’m starting to have doubt about this relase, might not be ready for prime time. Anyone know why this is happening?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2