0

When attempting to save a product (transferred originally from Mage 1 database) in Magento 2 I am receiving the following error.

Warning: imagejpeg(/var/www/html/pub/media/catalog/product/cache/1/swatch_image/30x20/beff4985b56e3afdbeabfc89641a4582/s/m/small-table_4_2.jpg): failed to open stream: Permission denied in /var/www/html/vendor/magento/framework/Image/Adapter/Gd2.php on line 181

If I visit this location in the file system the image does not exist.

If I look in the product page of admin panel or on the front end I can see no call to this specific image link.

Can anyone please assist?

2 Answers 2

1

Try to clear Catalog product image cache.

Make sure that /var/www/html/pub/media/catalog/product/cache/ is writable for the Magento user (maybe apache or nginx). Check parent folders also.

Try to delete var/di var/generation var/cache folders too.

Do you use swatch image for products ?

2
  • No we don't use swatch images for products. I will give that a try and let you know. Commented Feb 22, 2017 at 12:58
  • I get a permissions error when I try and run flush image cache. So I am guessing this will be the cause, and solution to my problem. I will update in due course. Commented Feb 22, 2017 at 14:20
0

This is resolved by giving all directories in /pub/ folder 775 permissions for the magento user. or we can give 777 permissions

1

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.