0

Now been at this for nearly 2 days...

Using Magento for years, never had this much trouble uploading images in bulk.

'Image does not exist' error when uploading a full product CSV with images attached. I have all images in media/import, all file names match, I have tried changing directory permissions, file permissions, trailing / on and off images. Have tried using Magmi, works fine for imports as long as images are not included..

Worth noting when the above error comes, no products will upload even without images... I have also found at different times the images are being assigned to products as within the product directories the image number directories have existed.

Only have 180-200 products, but 9 images per product, and the site needs to be update twice a day using CSV...

Really am lost for ideas now... very frustrating..

Let me know if i've missed anything!


Update... I have tried using a media_gallery header, CSV imports products not images, have tired using media/catalog/product/1/4 then image name, tried without / on file name, file names contain 3 underscores, have renamed images to remove them.. oddly some image have gone into media/catalog/product/1/4 directory though all of the above shows a 'image does not exist' error..

5
  • 1
    First of all check if you have 777 right on the media folder recursively. If that's already done, I don't have an idea on what's wrong, but I can give you a hint on where to start debugging. The error message you see comes from an exception thrown in Mage_Catalog_Model_Product_Attribute_Backend_Media::addImage. For some reason the $file = realpath($file); returns null or the file with that name does not exist. Try to log the values you get in that method and match them against the values you expect.
    – Marius
    Commented Feb 4, 2015 at 15:12
  • Ok, so for the third time today I have changed the permissions back to 777 from 755 and recursively through the directory.. havent ever debugged so ill try and see what I get.. Commented Feb 4, 2015 at 15:23
  • @marius not sure I follow the rest of your reply, thanks for your help though... Commented Feb 4, 2015 at 15:40
  • Do you have an example of the csv? and the images? in a zipfile ?
    – Evrijn
    Commented Feb 4, 2015 at 15:41
  • ngbmedia.co.uk/holden/afterchx.csv... csv is here..images are all sitting in the media/import folder...within csv image names are in place with / preceding the image name Commented Feb 4, 2015 at 15:44

2 Answers 2

1

Please check your memory limit (variable memory_limit in .htaccess, php.ini or ask your hoster). It should be something like "512M". The following values are not accepted by Magento: -1 1G

I have seen exactly this causing errors like the one you mentioned.

3
  • ok thanks for your help limit is 64m or 256m? Commented Feb 4, 2015 at 15:25
  • I recommend setting it to 512M or even 1024M for testing purposes. 64M is certainly too few. Commented Feb 4, 2015 at 15:26
  • thanks for your help, but it made no difference Commented Feb 4, 2015 at 15:41
1

Building on Marius's reply: PHP's realpath() function requires exec access to all directories in the entire tree, even the ones above the current directory.

If it doesn't, it returns false. You should be able to debug that value quite easily.

5
  • Good call. Why didn't I think of that? I bet this is the issue :).
    – Marius
    Commented Feb 4, 2015 at 15:20
  • Ensuring I have understood correctly media also needs to be 777... Commented Feb 4, 2015 at 15:29
  • Update... I have tried using a media_gallery header, CSV imports products not images, have tired using media/catalog/product/1/4 then image name, tried without / on file name, file names contain 3 underscores, have renamed images to remove them.. oddly some image have gone into media/catalog/product/1/4 directory though all of the above shows a 'image does not exist' error.. Commented Feb 5, 2015 at 8:59
  • Are you able to upload images via the backoffice? Have you checked your webserver error logs? And the Magento logs in var/logs/system.log or var/logs/exception.log?
    – dvdmierden
    Commented Feb 5, 2015 at 15:29
  • images upload fine manually will check logs Commented Feb 6, 2015 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.