magento2: 2.1.3 CE - Unable to set attribute set for new product (possibly data-migration issue)

Preconditions

  1. Magento 2.1.3 CE (from Composer)
  2. PHP v7.0.14 Apache

This was a 2.1.2 install which was then upgraded to 2.1.3 before any products/attributes were setup. Products/attributes were imported from 1.7.0.2 using the data-migration-tool.

Steps to reproduce

  1. Create an attribute set (I’m using some imported from Magento 1.7)
  2. Go to Products->Catalog and Select “Add Product” and Simple Product (Configurable Product also fails, not tested another). URL is currently https://XXXX/catalog/product/new/set/21/type/simple/key/KEY/
  3. Change the “Attribute Set” dropdown from Default to anything else. A POST call is made to: https://XXXX/admin/catalog/product/reload/type/simple/store/0/popup/1/componentJson/1/prev_set_id/21/key/KEY/?set=15&isAjax=true [post data includes a form_key and returns 181Kb of JSON] another POST is made to: https://XXXX/admin/catalog/product/reload/type/simple/store/0/popup/1/componentJson/1/prev_set_id/15/key/KEY/?set=undefined&isAjax=true which fails with a 503 Service Unavailable code [post data includes a form_key and returns a standard “There has been an error processing your request” with the corresponding var/report file containing:
a:4:{i:0;s:37:"attribute_set_id is a required field.";i:1;s:4163:"#0 /WEBROOT/vendor/magento/module-eav/Model/Attribute/GroupRepository.php(111): Magento\Framework\Exception\InputException::requiredField('attribute_set_i...')
#1 /WEBROOT/vendor/magento/module-catalog/Model/ProductAttributeGroupRepository.php(57): Magento\Eav\Model\Attribute\GroupRepository->getList(Object(Magento\Framework\Api\SearchCriteria))
#2 /WEBROOT/vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php(426): Magento\Catalog\Model\ProductAttributeGroupRepository->getList(Object(Magento\Framework\Api\SearchCriteria))
#3 /WEBROOT/vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php(241): Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav->getGroups()
#4 /WEBROOT/vendor/magento/module-catalog/Ui/DataProvider/Product/Form/ProductDataProvider.php(68): Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav->modifyMeta(Array)
#5 /WEBROOT/vendor/magento/framework/View/Element/UiComponentFactory.php(269): Magento\Catalog\Ui\DataProvider\Product\Form\ProductDataProvider->getMeta()
#6 /WEBROOT/vendor/magento/framework/View/Element/UiComponentFactory.php(164): Magento\Framework\View\Element\UiComponentFactory->mergeMetadata('product_form', Array, false)
#7 /WEBROOT/vendor/magento/framework/View/Layout/Generator/UiComponent.php(124): Magento\Framework\View\Element\UiComponentFactory->create('product_form', NULL, Array)
#8 /WEBROOT/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'product_form', Array, Object(Magento\Framework\View\Layout\Interceptor))
#9 /WEBROOT/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#10 /WEBROOT/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#11 /WEBROOT/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#12 /WEBROOT/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#13 /WEBROOT/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#14 /WEBROOT/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#15 /WEBROOT/vendor/magento/framework/View/Layout.php(935): Magento\Framework\View\Layout->build()
#16 /WEBROOT/var/generation/Magento/Framework/View/Layout/Interceptor.php(492): Magento\Framework\View\Layout->getOutput()
#17 /WEBROOT/vendor/magento/framework/View/Result/Layout.php(181): Magento\Framework\View\Layout\Interceptor->getOutput()
#18 /WEBROOT/vendor/magento/framework/View/Result/Layout.php(164): Magento\Framework\View\Result\Layout->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#19 /WEBROOT/var/generation/Magento/Framework/View/Result/Layout/Interceptor.php(89): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#20 /WEBROOT/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Layout\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#21 /WEBROOT/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#22 /WEBROOT/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#23 {main}";s:3:"url";s:192:"/XXXX/catalog/product/reload/type/configurable/store/0/popup/1/componentJson/1/prev_set_id/16/key/9b342c123e56ef9b1123af9d7cc8711bb6206efb3f693d9f74d1028b926d8834/?set=undefined&isAjax=true";s:11:"script_name";s:10:"/index.php";}

another POST is made to: https://XXXX/admin/catalog/product/reload/type/simple/store/0/popup/1/componentJson/1/prev_set_id/15/key/KEY/?set=&isAjax=true which fails with a 404 Forbidden code (and HTML is returned)

Expected result

  1. The list of attributes is updated

Actual result

  1. The “Please wait” spinner continues to show.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Moving price attribute to Product Details Tab resolved this issue for me.

This issue was a bit brain-teaser. We had found a temporary workaround - Duplicate the product & make the changes and this issue does not happen.

Hi, thank you for your report. It is a duplicate of 7579 and 5999. The problem is with incorrect attributes and attributes groups structure inside attribute set. The most common issue is with price attribute out of Product Details group and described in this comment. Try this solution

Hi all, I have the same issue as Topic Started wrote (exactly the same) We have a Migration_Default Attribute set. Solution for me (may be project specified solution but maybe useful for someone else): In Admin Panel relocate attribute quantity_and_stock status to Migration Prices attribute group (group with code advanced-pricing): https://monosnap.com/file/0H3dl34HyBXlI2tDqtvBtg6NlLIRuI https://monosnap.com/file/M9Iv1g7neSKqMdRZAbl3SGNpLSEA9S