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

Product will not export if product has image label names but no images #36749

Closed
5 tasks
git-seb opened this issue Jan 16, 2023 · 9 comments
Closed
5 tasks

Product will not export if product has image label names but no images #36749

git-seb opened this issue Jan 16, 2023 · 9 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5-p1 Indicates original Magento version for the Issue report.

Comments

@git-seb
Copy link

git-seb commented Jan 16, 2023

Preconditions and environment

  • Magento version 2.4.5-p1
  • Flat Catalog Product
  • Error in log: main.CRITICAL: Exception: Warning: Undefined array key "base_image" in /vendor/magento/module-catalog-import-export/Model/Export/Product.php on line 1404 in /vendor/magento/framework/App/ErrorHandler.php:62
  • I can see the product trying to export has image label names in the database (image_label, small_image_label, thumbnail_label) but no product images (image, small_image, thumbnail) resulting in the upper error when exporting. How those products have label names, is probably due to a product import, but should still not result in issues for exporting them.

Steps to reproduce

  1. Open System > Data Transfer > Export
  2. Choose Products
  3. Filter on SKU with image label names but no images

Expected result

Export successfully without issues

Actual result

Export fails or incomplete (leaves out products with having both cases: image label names + without images)

Additional information

No response

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 Jan 16, 2023

Hi @git-seb. 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 Jan 17, 2023

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: 👇

  • 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-Bravo engcom-Bravo added the Reported on 2.4.5-p1 Indicates original Magento version for the Issue report. label Jan 17, 2023
@engcom-Bravo
Copy link
Contributor

engcom-Bravo commented Jan 17, 2023

Hi @git-seb,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible. Kindly refer the screenhsots.

Steps to reproduce

1.Open System > Data Transfer > Export
2.Choose Products
3.Filter on SKU with image label names but no images

We are able to the export the product details successfully.

Screenshot 2023-01-17 at 5 25 36 PM

Below is the CSV file we have exported successfully.

export_catalog_product_20230117_152406.csv

We have tried with no images

Screenshot 2023-01-17 at 5 46 45 PM

Kindly recheck the behavior on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Jan 17, 2023
@git-seb
Copy link
Author

git-seb commented Jan 17, 2023

Hi @engcom-Bravo ,

yes issue is still reproducible, since I am currently figuring out a work around. Maybe I should explain a bit more. So when doing an export, the csv does contain the product throwing error in the log but not the product that comes after. The error in my first message then shows in system.log.

Maybe another good thing to note is we have enabled Flat Catalog Product, not sure if that is related. Should also note, your last screenshot with no images should have image labels but no images. (Thats how some of the products got imported.)

Here's the full error f.y.i.:

[2023-01-17T12:45:07.121390+00:00] main.CRITICAL: Exception: Warning: Undefined array key "base_image" in vendor/magento/module-catalog-import-export/Model/Export/Product.php on line 1404 in vendor/magento/framework/App/ErrorHandler.php:62
Stack trace:
#0 vendor/magento/module-catalog-import-export/Model/Export/Product.php(1404): Magento\Framework\App\ErrorHandler->handler(2, 'Undefined array...', '/home/eadaafds/...', 1404)
#1 vendor/magento/module-catalog-import-export/Model/Export/Product.php(977): Magento\CatalogImportExport\Model\Export\Product->updateGalleryImageData(Array, Array)
#2 vendor/magento/module-catalog-import-export/Model/Export/Product.php(914): Magento\CatalogImportExport\Model\Export\Product->getExportData()
#3 vendor/magento/module-import-export/Model/Export.php(196): Magento\CatalogImportExport\Model\Export\Product->export()
#4 vendor/magento/module-import-export/Model/Export/ExportManagement.php(66): Magento\ImportExport\Model\Export->export()
#5 vendor/magento/module-import-export/Model/Export/Consumer.php(85): Magento\ImportExport\Model\Export\ExportManagement->export(Object(Magento\ImportExport\Model\Export\Entity\ExportInfo))
#6 [internal function]: Magento\ImportExport\Model\Export\Consumer->process(Object(Magento\ImportExport\Model\Export\Entity\ExportInfo))
#7 vendor/magento/framework-message-queue/Consumer.php(172): call_user_func(Array, Object(Magento\ImportExport\Model\Export\Entity\ExportInfo))
#8 vendor/magento/framework-message-queue/Consumer.php(241): Magento\Framework\MessageQueue\Consumer->dispatchMessage(Object(Magento\Framework\MessageQueue\Envelope))
#9 vendor/magento/framework-message-queue/CallbackInvoker.php(95): Magento\Framework\MessageQueue\Consumer->Magento\Framework\MessageQueue\{closure}(Object(Magento\Framework\MessageQueue\Envelope))
#10 vendor/magento/framework-message-queue/Consumer.php(138): Magento\Framework\MessageQueue\CallbackInvoker->invoke(Object(Magento\MysqlMq\Model\Driver\Queue), '2000', Object(Closure), 9223372036854775807, 1)
#11 vendor/magento/module-message-queue/Console/StartConsumerCommand.php(94): Magento\Framework\MessageQueue\Consumer->process('2000')
#12 vendor/symfony/console/Command/Command.php(255): Magento\MessageQueue\Console\StartConsumerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 vendor/magento/framework/Interception/Interceptor.php(138): Magento\MessageQueue\Console\StartConsumerCommand\Interceptor->___callParent('run', Array)
#15 vendor/magento/framework/Interception/Interceptor.php(153): Magento\MessageQueue\Console\StartConsumerCommand\Interceptor->Magento\Framework\Interception\{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 generated/code/Magento/MessageQueue/Console/StartConsumerCommand/Interceptor.php(77): Magento\MessageQueue\Console\StartConsumerCommand\Interceptor->___callPlugins('run', Array, Array)
#17 generated/code/Magento/MessageQueue/Console/StartConsumerCommand/Proxy.php(143): Magento\MessageQueue\Console\StartConsumerCommand\Interceptor->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 vendor/symfony/console/Application.php(1021): Magento\MessageQueue\Console\StartConsumerCommand\Proxy->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(Magento\MessageQueue\Console\StartConsumerCommand\Proxy), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 bin/magento(23): Symfony\Component\Console\Application->run()
#23 {main} [] []

@engcom-Bravo
Copy link
Contributor

Hi @git-seb,

Thanks for your update.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

We have exported the product without image and we have exported product details successfully.when we have image for product for that product only we have image labels.Without image for a product we are not able to set the images labels for a product.

Screenshot 2023-01-18 at 4 30 27 PM

In logs we are not getting any error.

Screenshot 2023-01-18 at 4 29 17 PM

Screenshot 2023-01-18 at 4 29 45 PM

We have exported below CSV file

export_catalog_product_20230118_162653.csv

As per Magento docs Magento no longer recommends the use of a flat catalog as a best practice.
https://experienceleague.adobe.com/docs/commerce-admin/catalog/catalog/catalog-flat.html Kindly check this document.

Kindly recheck the behavior on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.

Thanks.

@git-seb
Copy link
Author

git-seb commented Jan 18, 2023

Hi @engcom-Bravo, I have found a workaround for myself. So if nobody else having this issue you can close this. My work around was just removing the label names (image_label, small_image_label, thumbnail_label) manually from catalog_product_entity_varchar in database for products who do not have any images and doing a reindex. That fixed the export for me. (Afterwards I did follow your suggestion to disable flat catalog.)

@engcom-Bravo
Copy link
Contributor

Hi @git-seb,

Thanks for your update.

Hence we are closing this issue as per latest comment #36749 (comment).

Thanks.

@claudioxu
Copy link

Hello, I got the same problem, do we have to remove the alt text?

@laucat
Copy link

laucat commented Oct 25, 2024

Sorry to resurrect this thread. But I just want to thank @git-seb for the work around in comment: #36749 (comment)

We experienced this exact same error in a multi-store install, running on M2.4.6. Had to use database query to find all the label text (image_label, small_image_label, thumbnail_label) that were not associated to a product image (ie: no image file path) in catalog_product_entity_varchar database table, at default and store view levels. Once these were all removed, then could export all the SKUs without issue and no longer see the error in log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5-p1 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

4 participants