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?

asked Feb 22, 2017 at 11:00

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 ?

answered Feb 22, 2017 at 12:40
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

answered Feb 22, 2017 at 16:15
1

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.