Skip to content

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

Closed
@dromoded

Description

@dromoded

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: ImportExportFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions