Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rbairwell opened this issue Dec 15, 2016 · 18 comments
Labels
bug report Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release

Comments

@rbairwell
Copy link

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.
@rbairwell
Copy link
Author

I've just tried creating a new Attribute Set based on "Default" (which has no modifications) with no additional settings - and I was able to switch to this attribute set without problems (switching to an imported one still has issues).

I then tried adding an imported attribute to the new attribute set and retried "Add Product" and this succeeded.

Continuing to investigate when I can, but looks like something faulted during import.

@rbairwell rbairwell changed the title 2.1.3 CE - Unable to set attribute set for new product 2.1.3 CE - Unable to set attribute set for new product (possibly data-migration issue) Dec 15, 2016
@rbairwell
Copy link
Author

Adding all the attributes to the "new" attribute set and I am able to create a new product with that attribute set. I'm still unable to create products with the existing (migrated) attribute sets. Modifying existing products using those sets works correctly.

@rudik99
Copy link

rudik99 commented Dec 18, 2016

I had this issue as well.

Two parts to fix:

My attribute sets were missing the "schedule design update" tab and the attributes;
I used this [even though it was for enterprise] and it worked.
#5350

Just look for system attributes that might be missing. I did a clean install on test system and replicated default attribute set.

  1. My default attribute set was one that didnt existing any more [this happened during migration from M1] - all I did was change it back to the real default in eav_entity_type table for entity type = catalog_product

Dont forget to clear browser cache and magento cache. For good measure, re compile and generate static files as well.

@olysenko
Copy link

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

@Koc
Copy link

Koc commented Feb 1, 2017

@olysenko have same problem. Price and price type attributes are located in product details group but it doesn't helps

@KrystynaKabannyk KrystynaKabannyk added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Feb 8, 2017
@rbairwell
Copy link
Author

rbairwell commented Feb 10, 2017

I managed to fix my case by going through manually and checking each attribute - it turns out the "Design..." fields (which I've never used) were missing from the imported ones which stopped it working. Be nice that instead of "silently erroring", Magento just added the missing required attributes.

@dunarri
Copy link

dunarri commented Feb 26, 2017

I had this issue too and nothing I tried could fix the migrated attribute sets. They have the design fields, they have price in the product details.
Eventually I created a new identical attribute set in Magento 2 and that one works. So my workaround became to just use this new attribute set for any new products.
As you mentioned existing products using the migrated attribute set seem to function properly, so at least I don't have to change all those over.

@dunarri
Copy link

dunarri commented Feb 28, 2017

Actually, we've updated to 2.1.5 and freshly migrated data from the 2.1.5 data migration tool and the problem is gone. Perhaps it was a problem with the way the data migration tool pulled in attribute sets but now it's fixed.

@Tristan-N
Copy link

Tristan-N commented Apr 4, 2017

Maybe this is related: #5505

@sskharate
Copy link

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.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Progress: needs update labels Sep 18, 2017
@magento-engcom-team
Copy link
Contributor

@rbairwell, thank you for your report.
The issue is already fixed in develop branch
But we will consider to backport the fix to patch releases

@magento-engcom-team magento-engcom-team added 2.2.x Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Oct 13, 2017
@magento-engcom-team magento-engcom-team added Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release labels Oct 13, 2017
@suthanalley
Copy link

I have create attribute set going through this tutorial https://magenticians.com/create-attribute-set-programmatically-magento-2/ . It helps me a lot to implement the code as i have not implemented the same for the first time but at last i fixed the error that i am having module not found.

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ghost
Copy link

ghost commented Nov 14, 2018

Hi @rbairwell The issue was re-tested and we can confirm that it was fixed on the 2.3 release branch. We closing this issue as fixed due to upcoming 2.3 release that will be available soon.

@kzozulya
Copy link

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

@sskharate
Copy link

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

Thanks saved my life :)

@Jeeva-Rathinam
Copy link

@olysenko have same problem. Price and price type attributes are located in product details group but it doesn't helps

@Koc May i know how did you solve this issue?

@Jeeva-Rathinam
Copy link

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

Thanks saved my life :)

@sskharate May i know how did you solve this issue?

magento-devops-reposync-svc pushed a commit that referenced this issue Aug 24, 2022
…CPT-490

[performance] ACPT-490:  Catalog Import attributes
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release
Projects
None yet
Development

No branches or pull requests