2

We downloaded and installed the most recent 1.9 version. This time it seemed to work just fine, which is rare in my limited experience with magento installs. That is, until I tried to add some categories in the Admin. Clicking on the category management page creates a fatal error and I don't know how to interpret this. Any ideas what could be wrong?

Here's the error the debug is giving me.

Warning: include(NULL.php): failed to open stream: No such file or directory in /home2/esdzone/public_html/lib/Varien/Autoload.php on line 94

#0 /home2/esdzone/public_html/lib/Varien/Autoload.php(94): mageCoreErrorHandler(2, 'include(NULL.ph...', '/home2/esdzone/...', 94, Array)

#1 /home2/esdzone/public_html/lib/Varien/Autoload.php(94): Varien_Autoload::autoload()

#2 [internal function]: Varien_Autoload->autoload('NULL')

#3 [internal function]: spl_autoload_call('NULL')

#4 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/Config.php(1352): class_exists('NULL')

#5 /home2/esdzone/public_html/app/Mage.php(463): Mage_Core_Model_Config->getModelInstance(' NULL', Array)

#6 /home2/esdzone/public_html/app/code/core/Mage/Eav/Model/Config.php(651): Mage::getModel(' NULL')

#7 /home2/esdzone/public_html/app/code/core/Mage/Eav/Model/Config.php(703): Mage_Eav_Model_Config->_createAttribute(Object(Mage_Eav_Model_Entity_Type), Array)

#8 /home2/esdzone/public_html/app/code/core/Mage/Catalog/Model/Config.php(323): Mage_Eav_Model_Config->importAttributesData('catalog_product', Array)

#9 /home2/esdzone/public_html/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php(59): Mage_Catalog_Model_Config->getAttributesUsedForSortBy()

#10 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(203): Mage_Catalog_Model_Category_Attribute_Source_Sortby->getAllOptions(false, true)

#11 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php(113): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset))

#12 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes->_prepareForm()

#13 /home2/esdzone/public_html/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml()

#14 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php(140): Mage_Core_Block_Abstract->toHtml()

#15 /home2/esdzone/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Catalog_Category_Tabs->_prepareLayout()

#16 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))

#17 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php(55): Mage_Core_Model_Layout->createBlock('adminhtml/catal...', 'tabs')

#18 /home2/esdzone/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Catalog_Category_Edit_Form->_prepareLayout()

#19 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))

#20 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php(93): Mage_Core_Model_Layout->createBlock('adminhtml/catal...')

#21 /home2/esdzone/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Widget_Form_Container->_prepareLayout()

#22 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))

#23 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/catal...', 'category.edit')

#24 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/catal...', 'category.edit')

#25 /home2/esdzone/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))

#26 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))

#27 /home2/esdzone/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()

#28 /home2/esdzone/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()

#29 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)

#30 /home2/esdzone/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php(201): Mage_Adminhtml_Controller_Action->loadLayout()

#31 /home2/esdzone/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_CategoryController->editAction()

#32 /home2/esdzone/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit')

#33 /home2/esdzone/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))

#34 /home2/esdzone/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()

#35 /home2/esdzone/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)

#36 /home2/esdzone/public_html/index.php(83): Mage::run('', 'store')

#37 {main}

3
  • Can you please describe your installation steps? Magento install should be quite simple. I've never had problems. Commented Feb 23, 2016 at 18:43
  • You're right, it was simple. I unpacked the zip, uploaded the files to root, navigated to the root of the domain in my browser, followed the steps it gave me and it created the database. Worked like a charm. But, there's a fatal error on this page which I don't quite understand.
    – MCP Media
    Commented Feb 23, 2016 at 19:13
  • Just one idea: can you check your read/write permissions on FS? My idea is that your Magento is unable to access some XML config file. Commented Feb 23, 2016 at 19:18

2 Answers 2

2

Not sure how much this will help you, but from a programmer's viewpoint, it looks like your system is trying to create a catalog (or other EAV) attribute that doesn't have an attribute_code set. This line right here is your culprit

#6 /home2/esdzone/public_html/app/code/core/Mage/Eav/Model/Config.php(651): Mage::getModel(' NULL')

#File: app/code/core/Mage/Eav/Model/Config.php
    if (!empty($attributeData['attribute_model'])) {
        $model = $attributeData['attribute_model'];
    } else {
        $model = $entityType->getAttributeModel();
    }
    $attribute = Mage::getModel($model)->setData($attributeData);

This could be because the attribute is missing from the database, has an incorrect attribute code in the database, or somehow has an incorrect relationship setup in the eav_attribute table or the catalog_eav_attribute attribute, or somehow has corrupt information set in the cache.

2
  • This was the hint I needed. I used Magmi to import a few hundrerd attributes from my previous install. Apparently the import created a bit of a mess on the backend. Thank you Alan!
    – MCP Media
    Commented Feb 23, 2016 at 20:50
  • @MCPMedia You're welcome, glad it helped! Don't forget to click the "accepted answer" link -- a higher acceptance percentage usually means future questions will be more likely to be answered (and I get more fake internet points) Commented Feb 24, 2016 at 0:04
1

You have some kind of consistency issue in you Magento DB.

Tracking down your dump you see your problem coming from the attributes used for category sorting.

You entry point is:

Mage_Catalog_Model_Config::getAttributesUsedForSortBy()

And if we go deeper in the Magento code we get:

Mage_Catalog_Model_Resource_Config::getAttributesUsedForSortBy()

The problem, as far as I can see, is coming from the results of the query inside that method that may be incomplete:

SELECT `main_table`.*, IF(al.value IS NULL, main_table.frontend_label, al.value) AS `store_label` FROM `eav_attribute` AS `main_table`
 INNER JOIN `catalog_eav_attribute` AS `additional_table` ON main_table.attribute_id = additional_table.attribute_id
 LEFT JOIN `eav_attribute_label` AS `al` ON al.attribute_id = main_table.attribute_id AND al.store_id = 0 WHERE (main_table.entity_type_id = 4) AND (additional_table.used_for_sort_by = 1)

So please run it and pase your results, it may give us one hint.

If you did not modify your DB, my idea is an inconsitency born from the impossibility to read some file (maybe an upgrade/install script or one XML config) that may have cause this problem.

Anyway, if you have such kind of problem and if it is an option for you, the best suggestion may be to reinstall it from scratch.

4
  • The problem stemmed from using a tool called Magmi to import the attributes from a previous install. I would have never been able to figure this out without help. Thank you for taking the time to help me out RiccardoT!!
    – MCP Media
    Commented Feb 23, 2016 at 21:07
  • Ok, so it was not a clean install :) Next time tell us you used MAGMI... it is a quite messy system sometime :) Commented Feb 23, 2016 at 21:09
  • Fair point. I was unaware that it was relevant because my limited knowledge of this system.
    – MCP Media
    Commented Feb 23, 2016 at 21:29
  • No problem ;) Just pay attention with MAGMI, it is powerful, but quite messy and unsecure. Also make sure it is not accessible from public browsing, it is not so safe. Commented Feb 23, 2016 at 21:31

Your Answer

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

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