Skip to content
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

Magento throws 'No such entity' when saving product with custom options #36464

Open
1 of 5 tasks
ksenia-zlotin opened this issue Nov 11, 2022 · 20 comments
Open
1 of 5 tasks
Labels
Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality Area: Product Component: Admin Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@ksenia-zlotin
Copy link

Preconditions and environment

  • 2.4.3-p1, 2.4.4 (vanilla installations)
  • Product must have at least one custom option
  • Might be a duplicate / related to Product save issue #28364

Steps to reproduce

  1. In a product with custom options, create a scheduled update and save the update
  2. Once the scheduled update appears at the top of the page, edit that update
  3. Update the timing of the scheduled update (move it further in the future, for example) and save this change to the update
  4. Save the product itself

Expected result

Product should be saved and not lose any of the scheduled updates

Actual result

Product fails to save, error is thrown 'No such entity'

Additional information

It seems that the error stems from the product option save failing, here:
src/magento/vendor/magento/module-catalog/Model/Product/Option/Repository.php:174
The product get fetched and has no options in it at all, which causes this error.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Nov 11, 2022

Hi @ksenia-zlotin. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-assistant
Copy link

m2-assistant bot commented Nov 11, 2022

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

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

  • 4. Verify that the issue is reproducible on 2.4-develop branch

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

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel engcom-Hotel added the Reported on 2.4.4 Indicates original Magento version for the Issue report. label Nov 14, 2022
@engcom-November
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-November
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-November
Copy link
Contributor

@magento give me 2.4-develop instance with edition ee

@magento-deployment-service
Copy link

Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-November
Copy link
Contributor

Hi @ksenia-zlotin ,
Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop enterprise editions both cloud and local instance but observed below different issue when scheduling the update.
"error: : The Future Update Start Time is invalid. It can't be earlier than the current time." is displayed even after selecting valid future update date and time.
image

report.CRITICAL: Magento\Framework\Exception\CouldNotSaveException: The Future Update Start Time is invalid. It can't be earlier than the current time. in /var/www/html/magento2/partners-magento2ee/app/code/Magento/Staging/Model/UpdateRepository.php:218

Kindly confirm if you have observed the same issue to update the description and confirm issue.
Thank you.

@engcom-November engcom-November added the Issue: needs update Additional information is require, waiting for response label Nov 15, 2022
@ksenia-zlotin
Copy link
Author

@engcom-November I did not observe this "Future Update Start Time is invalid" error. I scheduled the update in the future and before that schedule has begun I would update the schedule a second time. It seems that your scheduled update started a month ago (October 11th). Perhaps that is why this different error is observed.

@engcom-November
Copy link
Contributor

engcom-November commented Nov 16, 2022

Thank you for the response @ksenia-zlotin .
Rechecked the issue again on Magento 2.4-develop instance with enterprise edition modules enabled and the issue is reproducible with below steps followed:

  1. Created simple product with customizable option added
  2. Product edit page - Scheduled new update with both start date and end date set to future dates
  3. Refresh the page
  4. Edit scheduled update - Change the dates to other future dates
  5. Save the product
    Issue: "No such entity" error message is displayed to the user.
    Hence updating the description and confirming the issue.
    image

Exception stack trace:

#2 Magento\Catalog\Model\Product\Option\Repository\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#3 Magento\Catalog\Model\Product\Option\Repository\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Model/Product/Option/Repository/Interceptor.php:68]
#4 Magento\Catalog\Model\Product\Option\Repository\Interceptor->save() called at [app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php:113]
#5 Magento\Catalog\Model\Product\Option\SaveHandler->processOptionsSaving() called at [app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php:84]
#6 Magento\Catalog\Model\Product\Option\SaveHandler->execute() called at [lib/internal/Magento/Framework/EntityManager/Operation/Update/UpdateExtensions.php:49]
#7 Magento\Framework\EntityManager\Operation\Update\UpdateExtensions->execute() called at [partners-magento2ee/app/code/Magento/Staging/Model/Operation/Update/UpdateEntityVersion.php:61]
#8 Magento\Staging\Model\Operation\Update\UpdateEntityVersion->execute() called at [partners-magento2ee/app/code/Magento/Staging/Model/Operation/Update.php:193]
#9 Magento\Staging\Model\Operation\Update->processUpdate() called at [partners-magento2ee/app/code/Magento/Staging/Model/Operation/Update.php:218]
#10 Magento\Staging\Model\Operation\Update->execute() called at [lib/internal/Magento/Framework/EntityManager/EntityManager.php:106]
#11 Magento\Framework\EntityManager\EntityManager->save() called at [app/code/Magento/Catalog/Model/ResourceModel/Product.php:777]
#12 Magento\Catalog\Model\ResourceModel\Product->save() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#13 Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#14 Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product.php:58]
#15 Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product->addCommitCallback() called at [app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product.php:28]
#16 Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product->aroundSave() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:135]
#17 Magento\Catalog\Model\ResourceModel\Product\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#18 Magento\Catalog\Model\ResourceModel\Product\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php:194]
#19 Magento\Catalog\Model\ResourceModel\Product\Interceptor->save() called at [lib/internal/Magento/Framework/Model/AbstractModel.php:663]
#20 Magento\Framework\Model\AbstractModel->save() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#21 Magento\Catalog\Model\Product\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#22 Magento\Catalog\Model\Product\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#23 Magento\Catalog\Model\Product\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Model/Product/Interceptor.php:1706]
#24 Magento\Catalog\Model\Product\Interceptor->save() called at [app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php:143]
#25 Magento\Catalog\Controller\Adminhtml\Product\Save->execute() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#26 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#27 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#28 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php:23]
#29 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->execute() called at [lib/internal/Magento/Framework/App/Action/Action.php:111]
#30 Magento\Framework\App\Action\Action->dispatch() called at [app/code/Magento/Backend/App/AbstractAction.php:151]
#31 Magento\Backend\App\AbstractAction->dispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#32 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#33 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Magento/Backend/App/Action/Plugin/Authentication.php:145]
#34 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:135]
#35 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#36 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php:32]
#37 Magento\Catalog\Controller\Adminhtml\Product\Save\Interceptor->dispatch() called at [lib/internal/Magento/Framework/App/FrontController.php:245]
#38 Magento\Framework\App\FrontController->getActionResponse() called at [lib/internal/Magento/Framework/App/FrontController.php:212]
#39 Magento\Framework\App\FrontController->processRequest() called at [lib/internal/Magento/Framework/App/FrontController.php:147]
#40 Magento\Framework\App\FrontController->dispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#41 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#42 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#43 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#44 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [lib/internal/Magento/Framework/App/Http.php:116]
#45 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#46 Magento\Framework\App\Http\Interceptor->launch() called at [lib/internal/Magento/Framework/App/Bootstrap.php:264]
#47 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]
</pre> [] []```

@engcom-November engcom-November added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: Admin Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Product Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality labels Nov 16, 2022
@m2-community-project m2-community-project bot removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Nov 16, 2022
@m2-community-project m2-community-project bot added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: needs update Additional information is require, waiting for response labels Nov 16, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-7038 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Nov 16, 2022

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-November engcom-November added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Nov 16, 2022
@github-jira-sync-bot
Copy link

❌ You don't have permission to export this issue.

@Quazz
Copy link

Quazz commented Dec 19, 2022

Same thing happens when using "Save & Duplicate" on a product with custom options on 2.4.5

@shomiadarshlt
Copy link
Contributor

@magento I am working on this.

@saketjiva
Copy link

Hi Team ,

I am facing same issue while saving the product with custom options programmatically, please let me know if this is fixed, and what is the fix?

Thank you !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adobe Commerce The issue related to the Adobe Commerce(EE) or B2B functionality Area: Product Component: Admin Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Ready for Development
Development

No branches or pull requests

7 participants