-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
CSV Product Import - Images reporting failure. #2666
Comments
After a lot of digging i just found out that the images are correctly added to |
Is there any update on this issue yet? Any work arounds? Even a temp core hack to get product images in place would be great. |
After some digging I came up with a solution. It seems the issue with permissions error is related to the local file system only and not remote systems. When running the import and pulling off from http://domain.com/pub/media/import/image.jpg it works when the same files error out with only /pub/media/import/image.jpg Hope this helps someone. |
I managed to get around this after switching to PHP 7, did not manage to get around this on 5.6 - Runs perfectly on PHP7 in my case. |
I'm having the same problem when I try to import an image from a remote URL |
+1 Same issue here. Tried manually specifying a path like |
Hello Icereaper, I updated to PHP7 but I still don't see any images. So I have the same problem as described above : the base, small etc images are working. So the overview in frontend and backend are both having images. When editing the product, the gallery is empty. When entering the product detail-page, the images are missing. How did you manage to work around and import the image if i may ask? Thx |
Having same problem. Any update? |
As said, nothing ever worked, but then i tried to set the php version to 7.0 in the cpanel, and suddenly it worked. The switch to php 7.0 will have caused a different php.ini and extensions to be loaded, so it might be a php related setting. |
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. |
It's still not working in 2.1.0 GA |
I can confirm that. |
Still not working in 2.1.0
|
It seems it should not import cvs file from the template being exported directly. |
I am getting the same error message when i tried to import images from AWS. Posting here in case someone experiences the same issue in the future. After some digging, looks like it is failing because the my image links where containing a parameter ex. ?1415800484 As a result on media/import the image names where like that: and the Import was breaking. |
@vzabaznov Facing the same issue. PHP 5.6.23 (cli) (built: Jun 26 2016 13:17:47) Cent-OS 6 on aws |
I have fixed it by running the below on magento root directory ... Looks like the group or the user of apache/nginx does not have the permission to write on pub/media/catalog/product even if you don't have it on pub it will not allow you to write.
if you can add a log along with return false in the below function resides in
will help the developers to easily identify the issue. protected function uploadMediaFiles($fileName, $renameFileOff = false)
{
try {
$res = $this->_getUploader()->move($fileName, $renameFileOff);
return $res['file'];
} catch (\Exception $e) {
$this->_logger->critical($e); // Added by senthil_m
return '';
}
} |
My issue was resolved by ensuring all the URL's fetched from remote servers were properly URL encoded in my CSV. In particular, the remote URL filenames had spaces in them. If you were to replace all space characters with %20, you'll be fine. Hope that helps anybody else in the same boat as I was. |
receiving same message but for all images when importing from cvs file with images in pub/media/import folder. |
Not sure if this has anything to do with your issue as this is an internal import but I realized the CVS files should have no file path for the images. It should just be the image name. In M2 I have images stored in pub/media/import but would get the same error 1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 1, 2 I removed the path name from my CSV file and just have the image path as image.jpg with no slashes and it works great now. |
Can confirm that rosandrest's solution works, removing the external links altogether helped with 2.1 |
We had the exact same problem as explained here, but for us this had nothing to do with permissions or incorrect filepaths. Using the suggestion from @senthilengg by logging the exception in the 'uploadMediaFiles' function, we came to the conclusion that our client had uploaded corrupt .jpg files. In Magento\Framework\Image\Adapter\AbstractAdapter an exception was thrown in the 'validateUploadFile' function which caused the import to fail. I think this issue can be closed as it is not Magento who is causing this issue. |
@bacd there is internal ticket MAGETWO-58227 for your issue. This bug was fixed in 2.2 (branch 'develop') |
@IceReaper, @davidnguyen2205, @davidnguyen2205, @Ctucker9233, @yssource, @St0iK, @brendanbell if this issue is actual for you try to import images on Magento v2.2.0. It should work now. I can provide more details if somebody needs. |
Hi @TomashKhamlai, If not, I'd suggest marking the issue with the |
hi @TomashKhamlai ! edited: in my case turned out to be an issue probably reported in #10209 Magento 2 import products with images using CSV Issue |
Hello @romeof1980! You should be able to perform import on Magento 2.2.0. I think that you have problems in Step 5 of the instruction.
magento@TSG-215:/var/www/html/third$ groups ${whoami}
magento www-data More information here: #mage-owner-about-group
I attached zip file with images t.zip. You can copy it by FTP to magento@TSG-215:/var/www/html/third/var/import$ ls
t.zip
magento@TSG-215:/var/www/html/third/var/import$ unzip t.zip -d .
Archive: t.zip
creating: ./t/
creating: ./t/-/
inflating: ./t/-/t-shirt-mo-prob-lama-gallery_1.jpg
inflating: ./t/-/t-shirt-mo-prob-lama-normal_1.jpg
inflating: ./t/-/t-shirt-mo-prob-lama-back_1.jpg
inflating: ./t/-/t-shirt-mo-prob-lama_1.jpg
magento@TSG-215:/var/www/html/third/var/import$ ls
t t.zip
find var/import -type f -exec chmod g+w {} \; && find var/import -type d -exec chmod g+ws {} \; && chown -R magento:www-data var/import
|
Hello again. @romeof1980, I changed my mind. Pay more attention to step 2, and even much more to step 6. |
I was getting the same error, i fixed this. The solution was to have no spacial charechter, no space in the image file names. only alphabets and numbers. And it worked for me. |
so by summarising all the solutions I've seen here and in other places, I did the following:
as a result - everything worked PS if you following then do not forget to change image filenames to |
@site-me i have to say this is a dumb thing that most of us don't think about when uploading images. I was banging my head for about an hour before finding this and realizing how easy it was. |
@site-me Thanks a lot for the solution, i was stuck with this stupid image issue for over a week. Can u just clarify one more doubt of mine, when u said remove all alnum characters do u mean no special characters also i mean like can we not use a "-" or "_" in the image name? |
I’ve noticed some recommendations about naming files which reported by several people as helpful, so I included this in my solution. Yes I left only numbers an letters in the file names (and an extension of course) by applying hash function which gives you exactly this set of characters |
I am facing the same issue in Magento 2.3.1, To fix this I have follow the below steps:-
Hope that helps you |
I encountered this problem too and i was able to solve it with the following steps:
Hope this will help whosoever facing the same problem. |
Your image name should not have space or any special character to make it upload |
I realize this post is closed, but I wanted to add an update related to Magento ver. 2.3.2. I was running into this same error when uploading a csv that pulling a single image from an external url with no special characters or url related issues. A quick check of the exception.log and I saw this: In my scenario, it was due to the pub/media/import directory missing completely. So, even if you are downloading a file from an external url, Magento uses the import directory to stage the file. Good to know. |
this idea not worked for me |
THanks, problem solved |
In Magento2.3.3 CE there is no need to specify the path. Just paste product images at /var/import/images/ directory and Images will be uploaded successfully |
I am using Magento 2.3.2 version and tried a lot to import products but best solution I found
While import from backend put path 'pub/media/import/ For more you can check here https://magento.stackexchange.com/a/325213/82482 |
Short:
Step1: Created a product by hand and exported it as csv file.
Step2: Deleted the product, so the Database is empty again.
Step3: Uploaded the images
Step4: Imported the csv file
[base|small|thumbnail|swatch]_image are working.
additional_images is empty and throwing this error:
Long:
I've created a product by hand and exported it as CSV. I used that CSV file as pattern and added all the products.
I also uploaded the images in pub/media/import. I've put the first image as base_image small_image etc. and put every image again into the 'additional_images' column.
When pressing import (with correct image path entered) it finds all the images and copies them to pub/media/catalog/product. However it reports the following:
Now comes the weird part: the base, small etc images are working. So the overview in frontend and backend are both having images. When editing the product, the gallery is empty. When entering the product detail-page, the images are missing.
When exporting the products again the base, small etc fields are correctly set, additional_images are empty. So something musts be broken with that field regarding the import feature.
I would fix it by myself but have no single clue where to start looking for that. So if anyone has a hint or maybe even a fix for this, i would be very thankful.
(Before anyone asks, got the same problem when importing the exported csv without adding further products)
The text was updated successfully, but these errors were encountered: