cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to import images

Unable to import images

Greetings,

 

We are experimenting with Magento Community Edition 2.0, with a view to use Enterprise if we are happy with it.

 

I am having trouble importing products with images.

 

I have a single item in my CSV (based on the example import data CSV provided by Magento) which references a single 'base_image' named: '/o_843054.jpg'.

Within the import utility I designate my images file directory as 'var/masdataimages/loctite'. The full OS path is: '/var/www/shop.mydomain.co.uk/var/masdataimages/loctite/o_843054.jpg'.

  

From the command line I can browse to this image as 'root' or the magento user 'magentouser'.

 

Everytime I run the importer it consistently accepts the data values but fails to import the image, with error:

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

 

How can there be a permission issue when I know the magento user can read it?

 

The HTTPD error log gives me nothing, and '/var/www/shop.mydomain.co.uk/var/log/' is about as useless as a pub with no beer!

 

I don't know if it's a generic error. I don't know if it's trying to access the image file as the apache user, or the magento user, or what. The feedback is just too vague.

 

'masdataimages' is an NFS share, but as I said, I can access it fine on the command line. By example I can demonstrate accessing the file and copying it to '/tmp' as user 'magentouser':

[root@vm-h002474-b2c loctite]# su - magentouser
[magentouser@vm-h002474-b2c ~]$ cd /var/www/shop.mydomain.co.uk/var/masdataimages/loctite
[magentouser@vm-h002474-b2c loctite]$ ls -lha o_BL3616.jpg
-rw-rw---- 1 nobody nobody 3.2M Feb 14  2003 o_BL3616.jpg
[magentouser@vm-h002474-b2c loctite]$ cp -a o_BL3616.jpg /tmp/
[magentouser@vm-h002474-b2c loctite]$ ls -lha /tmp/o_BL3616.jpg
-rw-rw---- 1 magentouser apache 3.2M Feb 14  2003 /tmp/o_BL3616.jpg

 

I would really appreciate someone pointing out what I am overlooking.

 

Thanks in advance.

 

Elliot

 

3 REPLIES 3

Re: Unable to import images

I was getting the same error message when trying to upload images, but I realized I had them in the incorrect media/import folder.  I uploaded the images to /pub/media/import and now it is working for me.  I hope this helps!

Re: Unable to import images

I'm having frustrations with this error also.

 

I'm using Magento 2.0.2 and trying to figure out how to get this right so I have a method to rely on in future. I've attempted the following:

  • storing the images within sub-directories in the default /import folder (eg: /import/00-000/image1.png)
  • storing these images together in the /import folder (eg: import/00-000-01.png)
  • denoting the location in the upload CSV file entry for base_image as the relative or as the full path (eg: /00-000-01.png or http://<domain>/html/pub/media/import/00-000-1.png)  
  • uploading the image to a publicly visible dropbox directory and linking directly to the images there
  • uploading the images to a publicly visible directory on another server and linking directly to the images there. 
  • increasing the admin session timeout to 45 minutes to ensure enough time is given to download images from external sources

In every instance, after a period of over a minute's wait I receive the same error for some or all SKUs

Imported resource (image) could not be downloaded from external resource due to timeout or access permissions

I'm a novice to this, but I feel with so many variations on the source that the error must stem from how Magento is attempting to reach the image content. I could be wrong. In any case it seems similar to the issue you're having hgpit.

Re: Unable to import images

 

ssh to the box and run the below from the magento root directory.

 

find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;