Description
Preconditions (*)
- Magento 2.4.6-p4
- Magento 2.4.7
- Magento Developer branch
- Indexer mode: Update by schedule
Description (*)
When we upload an image to the product and without saving the product again we delete the image and then we save the product, the image is added for resize in queue. And the error of system message is shown with failure of queue message.
Steps to reproduce (*)
- Access magento admin panel and set the indexer mode to Update by Schedule
- Go to Catalog->Product.
- Create a product or edit any existing product and upload a image and again remove the uploaded image without saving the product.
- Then save the product.
- Run media.storage.catalog.image.resize consumer
Expected result (*)
As the image was not saved to the product, hence the image should not be added to the queue for image resize.
Actual result (*)
As the image was not saved to the product, but the image is getting added to the queue for image resize.
Additional information (*)
When we upload the image, a copy of the image is created in tmp folder. And when we remove the image without saving the product the image in the tmp folder is not removed and hence the path of the image is sent to the Image resize queue due to which the consumer is not able to locate the .tmp image file in pub/media/catalog/product path as the .tmp image never existed in the given path.
Hence, it results into the failure of queue and it throws a system message.
Files:
- magento/module-catalog/Controller/Adminhtml/Product/Gallery/Upload.php
- magento/module-catalog/Observer/ImageResizeAfterProductSave.php
- magento/module-media-storage/Service/ImageResize.php
Upload controller is called when we upload a image and it sets the response and send it to the ImageResizeAfterProductSave observer in which the image file name is sent to the queue using ImageResize.
Even if we remove the product image right after uploading it and without saving the product, Upload controller still send the image path with .tmp extension to the observer and from there it goes to queue which fails afterwards.
Activity
m2-assistant commentedon Sep 6, 2024
Hi @kapilpandya2203. Thank you for your report.
To speed up processing of this issue, 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@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ 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.
m2-assistant commentedon Sep 6, 2024
Hi @engcom-Bravo. 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: 👇
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branchDetails
- 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 labelReproduced 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!
Issue: Confirmed
once verification is complete.engcom-Bravo commentedon Sep 10, 2024
@magento give me 2.4-develop instance
magento-deployment-service commentedon Sep 10, 2024
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
magento-deployment-service commentedon Sep 10, 2024
Hi @engcom-Bravo, here is your Magento Instance: https://9c10b8a9a6b79402f15f816d06a43c67.instances-prod.magento-community.engineering
Admin access: https://9c10b8a9a6b79402f15f816d06a43c67.instances-prod.magento-community.engineering/admin_811f
Login: cb25c0f4
Password: 12d2437f9b6d
engcom-Bravo commentedon Sep 10, 2024
Hi @kapilpandya2203,
Thanks for your reporting and collaboration.
We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
Steps to reproduce
As the image was not saved to the product, but the image is getting added to the queue for image resize.
Hence Confirming the issue.
Thanks.
4 remaining items
m2-assistant commentedon Sep 10, 2024
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
KrasnoshchokBohdan commentedon Apr 28, 2025
@magento I am working on this
magento#39146: Image resize queue error due to .tmp file handling whe…
magento#39146: Image resize queue error due to .tmp file handling whe…
magento#39146: Image resize queue error due to .tmp file handling whe…
magento#39146: Image resize queue error due to .tmp file handling whe…
magento#39146: Image resize queue error due to .tmp file handling whe…