Magento – Warning: imagejpeg ‘Failed to open stream’ on product update Magento 2

magento2permissionsproduct-images

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/30×20/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?

Best Answer

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 ?

Related Topic