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

Unable to import external jpeg images from a CDN with dynamic URLs. #12533

Closed
dromoded opened this issue Dec 4, 2017 · 6 comments
Closed

Unable to import external jpeg images from a CDN with dynamic URLs. #12533

dromoded opened this issue Dec 4, 2017 · 6 comments
Labels
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 valid Gate 1 Passed. Automatic verification of issue format passed 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

@dromoded
Copy link

dromoded commented Dec 4, 2017

Unable to import products with external jpeg images hosted on a CDN with dynamic URLs not ending with ".jpg" or ".jpeg", e.g.
http://asset.lemansnet.com/media/edge/8/4/0/840EC331-41BE-4AFF-9392-4A35F2C486A9.png?x=260&y=260&b=ffffff&t=image/jpeg
(This is a real image, and it is indeed a jpeg. Parameters "x" and "y" control image size, "b" - background color)

The same procedure as described below succeeds for a "plain" image URL (verified for
http://cdn.cnn.com/cnnnext/dam/assets/160405140459-06-nba-finals-superlatives-tease-only-large-tease.jpg )

Preconditions

  1. Magento 2.2.1 CE, Composer install
  2. CentOS-7, PHP-7.0.25, NGINX-1.12 + PHP-FPM, Percona-5.7.19
  3. "2-users" setup as described in the installation manual (usermod -a -G nginx maguser, FPM owned by nginx, sgid on directories)

Steps to reproduce

  1. Create the following CSV import file:
sku,product_type,attribute_set_code,name,price,base_image
12345,simple,Default,Test,10,http://asset.lemansnet.com/media/edge/8/4/0/840EC331-41BE-4AFF-9392-4A35F2C486A9.png?x=260&y=260&b=ffffff&t=image/jpeg
  1. Magento > Admin > System > Import:
    Entity Type: Products
    Import Behavior: Add/Update
    Stop on Error
    Allowed Errors Count: 10
    Field Separator: ,
    Multiple Value Separator: ,
    Field Enclosure: checked
    Select File to Import: the file created in step 1
    Images File Directory: (left empty)
  2. Click "Check Data"
    Click "Import"

Expected result

  1. Product "Test", should be created with the base image, as specified in the import file.
  2. The product should appear in the Admin>Catalog>Products list with the specified base image.
  3. The image should be downloaded and saved in ~/pub/media/catalog/product/h/t

Actual result

  1. "Check Data" returns 'File is valid! To start import process press "Import" button'
    Import returns the following error:
    "Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 1"
  2. Product "Test" is created and appears in Admin>Catalog>Products as specified minus image.
  3. The image is downloaded and saved in ~/pub/media/import with the file name
    httpasset.lemansnet.commediaedge840840EC331-41BE-4AFF-9392-4A35F2C486A9.pngx260y260bfffffftimagejpeg
    (verified that it is indeed the right jpeg image file)
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Dec 4, 2017
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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 Dec 4, 2017
@EliasZ
Copy link
Contributor

EliasZ commented Dec 6, 2017

This is related to: #12455

Not exactly the same, but similar problem case. In this case GET params are present in the URL and due to regex stripping characters, the GET params are appended to the file extension resulting in breaking the validation rules.

@PieterCappelle
Copy link
Contributor

@okorshenko Can you assign this to me?

@PieterCappelle
Copy link
Contributor

Should be fixed. If accepted I'll create backport to 2.2 & 2.1.

@magento-team
Copy link
Contributor

Hi @dromoded. Thank you for your report.
The issue has been fixed in #12872 by @PieterCappelle in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

@piotrekkaminski
Copy link
Contributor

This issue was moved to magento-engcom/import-export-improvements#77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 valid Gate 1 Passed. Automatic verification of issue format passed 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

8 participants