cancel
Showing results for 
Search instead for 
Did you mean: 

Adding products crashes Magento

Adding products crashes Magento

I've got a fresh install of Magento 2.0. I've created my websites and stores, added my product categories, done some basic configuration; setting email addresses, locale, currency, etc. I've also enabled flat categories and products and disabled caching.

 

I'm ready to add products, but Magento just won't do it. I enter the product name, sku, category, price, and description, but when I hit save, it all falls in a heap and I get a screen full of this;

 

[EDIT] I've tried disabling the flat product and flat category and the problem doesn't occur. Magento has a bug that prevents products being added when these are enabled. Even worse is that once you attempt to add a product with flat product and flat category enabled it get's itself ties up in knots and it's not possible to get back to a stable state. This suggests an improper implementation of database transactions that leads to artifacts being left in the database after failures.

 

exception 'Magento\Framework\Exception\LocalizedException' with message 'The specified "/var/www/html/magento/var/generation/Magento/Catalog/Model/Indexer/Product/Flat/Interceptor.php.1547" file could not be written Warning!file_put_contents(/var/www/html/magento/var/generation/Magento/Catalog/Model/Indexer/Product/Flat/Interceptor.php.1547): failed to open stream: Permission denied' in /var/www/html/magento/vendor/magento/framework/Code/Generator.php:103 Stack trace: #0 /var/www/html/magento/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\Catalog...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Catalog...') #2 [internal function]: spl_autoload_call('Magento\Catalog...') #3 /var/www/html/magento/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Catalog...') #4 /var/www/html/magento/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Catalog...') #5 /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Catalog...') #6 /var/www/html/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Catalog...', Array) #7 /var/www/html/magento/vendor/magento/framework/Indexer/ActionFactory.php(35): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Catalog...', Array) #8 /var/www/html/magento/vendor/magento/module-indexer/Model/Indexer.php(380): Magento\Framework\Indexer\ActionFactory->create('Magento\Catalog...', Array) #9 /var/www/html/magento/vendor/magento/module-indexer/Model/Indexer.php(433): Magento\Indexer\Model\Indexer->getActionInstance() #10 /var/www/html/magento/vendor/magento/module-catalog/Model/Indexer/Product/Flat/Processor.php(43): Magento\Indexer\Model\Indexer->reindexRow('1') #11 /var/www/html/magento/vendor/magento/module-catalog/Model/Product.php(1008): Magento\Catalog\Model\Indexer\Product\Flat\Processor->reindexRow('1') #12 /var/www/html/magento/var/generation/Magento/Catalog/Model/Product/Interceptor.php(440): Magento\Catalog\Model\Product->reindex() #13 [internal function]: Magento\Catalog\Model\Product\Interceptor->reindex() #14 /var/www/html/magento/vendor/magento/framework/Model/ResourceModel/AbstractResource.php(94): call_user_func(Array) #15 /var/www/html/magento/var/generation/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php(713): Magento\Framework\Model\ResourceModel\AbstractResource->commit() #16 /var/www/html/magento/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1156): Magento\Catalog\Model\ResourceModel\Product\Interceptor->commit() #17 [internal function]: Magento\Eav\Model\Entity\AbstractEntity->save(Object(Magento\Catalog\Model\Product\Interceptor)) #18 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array) #19 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callParent('save', Array) #20 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'save', Object(Magento\Catalog\Model\ResourceModel\Product\Interceptor), Array, 'catalogsearchFu...') #21 /var/www/html/magento/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php(28): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Catalog\Model\Product\Interceptor)) #22 [internal function]: Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product->aroundSave(Object(Magento\Catalog\Model\ResourceModel\Product\Interceptor), Object(Closure), Object(Magento\Catalog\Model\Product\Interceptor)) #23 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array) #24 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'save', Object(Magento\Catalog\Model\ResourceModel\Product\Interceptor), Array, 'apply_catalog_r...') #25 /var/www/html/magento/vendor/magento/module-catalog-rule/Plugin/Indexer/Product/Save/ApplyRules.php(40): Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Catalog\Model\Product\Interceptor)) #26 [internal function]: Magento\CatalogRule\Plugin\Indexer\Product\Save\ApplyRules->aroundSave(Object(Magento\Catalog\Model\ResourceModel\Product\Interceptor), Object(Closure), Object(Magento\Catalog\Model\Product\Interceptor)) #27 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array) #28 /var/www/html/magento/var/generation/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php(650): Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callPlugins('save', Array, Array) #29 /var/www/html/magento/vendor/magento/framework/Model/AbstractModel.php(615): Magento\Catalog\Model\ResourceModel\Product\Interceptor->save(Object(Magento\Catalog\Model\Product\Interceptor)) #30 /var/www/html/magento/var/generation/Magento/Catalog/Model/Product/Interceptor.php(2351): Magento\Framework\Model\AbstractModel->save() #31 /var/www/html/magento/vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php(84): Magento\Catalog\Model\Product\Interceptor->save() #32 /var/www/html/magento/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php(24): Magento\Catalog\Controller\Adminhtml\Product\Save->execute() #33 /var/www/html/magento/vendor/magento/framework/App/Action/Action.php(102): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->execute() #34 /var/www/html/magento/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #35 [internal function]: Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http)) #36 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array) #37 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callParent('dispatch', Array) #38 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor), Array, 'adminAuthentica...') #39 /var/www/html/magento/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http)) #40 [internal function]: Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #41 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array) #42 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor), Array, 'designLoader') #43 /var/www/html/magento/vendor/magento/framework/App/Action/Plugin/Design.php(39): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http)) #44 [internal function]: Magento\Framework\App\Action\Plugin\Design->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #45 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array) #46 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor), Array, 'adminMassaction...') #47 /var/www/html/magento/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #48 [internal function]: Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #49 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array) #50 /var/www/html/magento/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php(39): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callPlugins('dispatch', Array, Array) #51 /var/www/html/magento/vendor/magento/framework/App/FrontController.php(55): Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #52 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http)) #53 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array) #54 /var/www/html/magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array) #55 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install') #56 /var/www/html/magento/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #57 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #58 /var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array) #59 /var/www/html/magento/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array) #60 /var/www/html/magento/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #61 /var/www/html/magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch() #62 /var/www/html/magento/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #63 {main}

2 REPLIES

Re: Adding products crashes Magento

Re: Adding products crashes Magento

I have two questions;

 

1. Why should I need to set permissions for any Magento files? Magento should deal with this during installation.

 

2. Why is it that others are able to add products in Magento without having this problem?

 

Something is not right here. No configuration has been done outside of the Magento Admin Panel and no extensions have been installed. It would seem that Magento has a bug that only occurs under specific circumstances.