magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.54k stars 9.32k forks source link

Uploading base64 encoded image via Product API doesn't display some images stored in tmp directory #30381

Closed tanimoto-true closed 3 years ago

tanimoto-true commented 4 years ago

Summary

I created new product via product API with some base64 encoded jpeg images. But only one image displays in frontend and admin page. Looks like other images are saved in tmp directory and those are not displayed.

Preconditions (*)

  1. Magento ver. 2.3.4-p2
  2. php v7.2.33
  3. MySql v5.7

Steps to reproduce (*)

  1. Upload new product via product rest API

Expected result (*)

  1. All images display correctly

Actual result (*)

  1. All images not display

Only first image displays but other images not.

catalog_product_entity_media_gallery table data

value_id, attribute_id, value,                  media_type, disabled
'1',      '90',        '/0/1/01191048_01.jpg',  'image',    '0'
'2',      '90',        '/0/1/01191048_02.jpg',  'image',    '0'
'3',      '90',        '/0/1/01191048_03.jpg',  'image',    '0'
'4',      '90',        '/0/1/01191048_04.jpg',  'image',    '0'
'5',      '90',        '/0/1/01191048_05.jpg',  'image',    '0'

Image saved in following path

When accessing admin panel

images not display スクリーンショット 2020-10-09 13 09 13

debug.log

[2020-09-11 06:22:53] main.WARNING: Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_05.jpg {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_05.jpg at /var/www/magento/src/lib/internal/Magento/Framework/Filesystem/Driver/File.php:73)"} []
[2020-09-11 06:22:53] main.WARNING: Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_04.jpg {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_04.jpg at /var/www/magento/src/lib/internal/Magento/Framework/Filesystem/Driver/File.php:73)"} []
[2020-09-11 06:22:53] main.WARNING: Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_02.jpg {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_02.jpg at /var/www/magento/src/lib/internal/Magento/Framework/Filesystem/Driver/File.php:73)"} []
[2020-09-11 06:22:53] main.WARNING: Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_03.jpg {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Cannot gather stats! Warning!stat(): stat failed for /var/www/magento/src/pub/media/catalog/product/0/1/01191048_03.jpg at /var/www/magento/src/lib/internal/Magento/Framework/Filesystem/Driver/File.php:73)"} []

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 4 years ago

Hi @tanimoto-true. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

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

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

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

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

riddhiwagento commented 4 years ago

@magento I am working on it

m2-assistant[bot] commented 4 years ago

Hi @riddhiwagento! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

riddhiwagento commented 4 years ago

@magento add to contributors team

m2-assistant[bot] commented 4 years ago

Hi @riddhiwagento! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

riddhiwagento commented 4 years ago

@magento I am working on this

tanimoto-true commented 4 years ago

I removed id parameter from object in media_gallery_entries in post payload, then images started showing properly.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!