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

Improve error reporting for products images import #4711

Closed
leoquijano opened this issue May 25, 2016 · 9 comments
Closed

Improve error reporting for products images import #4711

leoquijano opened this issue May 25, 2016 · 9 comments
Assignees
Labels
bug report Component: ImportExport 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 not valid Gate 1 Failed. Automatic verification of issue format is failed 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 Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@leoquijano
Copy link

When importing products using the System -> Import Products feature, if there problems importing the images, Magento just fails with:

1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in rows: ...

No information is given about the cause of the problem, nor any help for the developer to sort it out. Generic calls to fix permissions don't really help, and it makes the process of importing products way longer than expected.

As explained here, exception handling could be improved to provide helpful messages to the developer. In particular, the following can be added to vendor/magento/module-catalog-import-export/Model/Import/Product.php:

protected function uploadMediaFiles($fileName, $renameFileOff = false)
{
    try {
        $res = $this->_getUploader()->move($fileName, $renameFileOff);
        return $res['file'];
    } catch (\Exception $e) {
        return '';
    }
}

Swallowing exceptions is a very bad thing, so it'd be a good idea to improve it like this:

protected function uploadMediaFiles($fileName, $renameFileOff = false)
{
    try {
        $res = $this->_getUploader()->move($fileName, $renameFileOff);
        return $res['file'];
    } catch (\Exception $e) {
        $this->_logger->critical($e);
        return '';
    }
}
@wert2all
Copy link
Contributor

Please, provide the used version. If the problem is actual for a specific branch, please, specify it and be sure that the latest update was used.

@leoquijano
Copy link
Author

leoquijano commented Jun 23, 2016

Thanks @wert2all. This is branch 2.0, specifically in my case, version 2.0.7:

https://github.com/magento/magento2/blob/2.0/app/code/Magento/CatalogImportExport/Model/Import/Product.php

@vkorotun vkorotun removed the MX label Aug 4, 2016
@wert2all wert2all removed their assignment Aug 17, 2016
@BaDos BaDos self-assigned this Sep 14, 2016
@BaDos BaDos added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 2.0.x labels Sep 14, 2016
@BaDos
Copy link
Contributor

BaDos commented Sep 14, 2016

Hi @leoquijano

Thank you for reporting.
We've created the internal ticket MAGETWO-58375 to resolve this issue.

@BaDos BaDos removed their assignment Sep 14, 2016
@magento-engcom-team magento-engcom-team added 2.0.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Component: ImportExport labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added 2.2.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 20, 2017
@magento-engcom-team
Copy link
Contributor

@leoquijano, thank you for your report.
We've created internal ticket(s) MAGETWO-58375 to track progress on the issue.

@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 20, 2017
@leoquijano
Copy link
Author

@okorshenko
Copy link
Contributor

@leoquijano the issue has been fixed and delivered to 2.2-develop branch. Will be available with 2.2.2 release

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82886

@leoquijano
Copy link
Author

Thank you.

@ishakhsuvarov
Copy link
Contributor

Hi @leoquijano. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1201 by @nmalevanec in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

@ishakhsuvarov ishakhsuvarov added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 22, 2018
magento-engcom-team pushed a commit that referenced this issue Aug 30, 2019
[chaika] MC-17824: MAP and MSRP are being used interchangeably when they are different
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: ImportExport 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 not valid Gate 1 Failed. Automatic verification of issue format is failed 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 Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

10 participants