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

Images imported via URL have crazy file paths #5306

Closed
hgpit opened this issue Jun 28, 2016 · 16 comments
Closed

Images imported via URL have crazy file paths #5306

hgpit opened this issue Jun 28, 2016 · 16 comments
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

@hgpit
Copy link

hgpit commented Jun 28, 2016

Steps to reproduce

  1. Install Magento v2.1 EE.
  2. Import product CSV using URLs for images (i.e.: base_image: "http://datastore.mydomain.local/imageserver/40354768_big.jpg").

Expected result

  1. File is stored in Magento file system as [magento]/pub/media/catalog/product/4/0/40354768_big.jpg.

Actual result

  1. File is stored in Magento file system as [magento]/pub/media/catalog/product/h/t/httpdatastore.mydomain.localimageserver40354768_big.jpg

When importing hundreds of thousands of products/images you end up with literally hundreds of thousands of files just under one folder: [magento]/pub/media/catalog/product/h/t/. So the file distribution logic of directory hierarchy creation based on the first two characters of the filename is futile/wasted - as the files will always be stored under /h/t/.

We are concerned that this could lead to speed issues accessing the /h/t/ folder. Certainly FTPing to the folder from a remote system could cause the FTP clients to hang (or stall for a long period).

Thank you

@hgpit hgpit changed the title Images imported via URL have stupid filename Images imported via URL have crazy file paths Jul 6, 2016
@hgpit
Copy link
Author

hgpit commented Jul 6, 2016

Are we really the only users who find this approach for file-naming a bit... ridiculous? Surely it's not the intended functionality?

@Ctucker9233
Copy link

@hgpit You're not the only one. It seems excessive. But it might be because you can run multiple stores/websites on the same magento setup. If you have any product crossover, there may need to be a way for magento to create a unique file name.

@hgpit
Copy link
Author

hgpit commented Jul 6, 2016

@Ctucker9233 I'm not really sure what you mean, sorry. We do actually run multiple websites and stores. But as every product image is imported via a URL, they're all still filed under [magento]/pub/media/catalog/product/h/t/ regardless of the site/store because of their source path/URL.

We've just invested in Unirgy's uRapidFlow product importer for EE v2.1, and that brings in images (via URLs) "properly", as-in my above expected result. So I still think M2's current folder creations method is wrong/broken.

@Ctucker9233
Copy link

@hgpit Ok, I understand now. What I meant is that might be part of Magento's Core structure to create a unique filename for each instance of an image. So if you have the same image on two sites, Magento can tell the difference between the two instances of that image. I'm just speculating this might be the case for the weird file naming.

@andimov
Copy link
Contributor

andimov commented Jul 29, 2016

@hgpit
Thank you for reporting!
datastore.mydomain.local is a weird domain for importing. Try to use local paths.

@hgpit
Copy link
Author

hgpit commented Jul 29, 2016

@andimov
"Try to use local paths.". What kind of answer/suggestion is that? Magento 2 provides the facility to import from URLs but because I'm reporting an issue with it, you're suggesting not to use the feature?

Also, how is "datastore.mydomain.local" a weird domain for importing? Aside from the fact I have blatantly replaced the domain name with a generic one for the purpose of example; we have an internal server which serves all our image data, so for instance if we have a corporate product SKU of 12345 we can point any browser/system on our network to http://datastore.mydomain.local/imageserver/12345.jpg and it will return the image. There is nothing weird about it.

@andimov
Copy link
Contributor

andimov commented Aug 16, 2016

@hgpit
Try to use one of iana list of tlds for importing from URLs.
Please, let me know when your issue will be solved.

@hgpit
Copy link
Author

hgpit commented Aug 16, 2016

@andimov
I can't (and would not) change my entire enterprise's internal domain naming conventions for Magento.

@shiftedreality
Copy link
Member

Hi @hgpit

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

@shiftedreality shiftedreality added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Sep 9, 2016
@magicsss
Copy link

Hi there.
Does anybody find solution for this issue?

@qx54
Copy link

qx54 commented Jun 6, 2017

We ran into the same issue. The Magento import should definitely not include the path of the external URL in the filename. Bad for SEO beside other reasons.

@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 bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Component: ImportExport labels Sep 11, 2017
@joachimVT
Copy link

I can confirm this, having the same issue in version 2.1.8

pub/media/catalog/product/cache/image/e9c3970ab036de70892d86c6d221abfe/h/t/httpwww.vinesse.bemediacatalogproductpapapeclement2012.png

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

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

@magento-engcom-team magento-engcom-team added develop 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 19, 2017
@piotrekkaminski
Copy link
Contributor

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

@PieterCappelle
Copy link
Contributor

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

@magento-team
Copy link
Contributor

Hi @hgpit. 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.

@magento-team magento-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 3, 2018
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