One of the products in my store don't have image associated with it, infact image was available on staging server and when moved to production image is no more available. I'm trying to re-upload the image but soon as I hit edit product button it issues following error (warning):

Cannot gather stats! Warning!stat(): stat failed for /var/www/vhosts/example.co.uk/example.co.uk/pub/media/catalog/product/b/u/business.jpg

  • Looks like permission issue. Please check with your hosting provider
    – Jackson
    Oct 5, 2016 at 1:57

3 Answers 3


It's a bug in Magento2 which can be reproduced by following these step:

  1. Upload an image to product
  2. Delete product image from files (pub/media)
  3. Edit the product in admin panel and you'll see this error


Fix is provided by Magento team on Github


Please run below sql code

SET @file = '/b/u/business.jpg';
DELETE FROM catalog_product_entity_media_gallery WHERE value = @file;
DELETE FROM catalog_product_entity_varchar WHERE value = @file;
  • Hii prnt.sc/vna70x I was facing the same issue in my project so I have found that the 3.png file was missing in the pub/media/amasty/flags/ directory and after adding this file my issue is resolved. Nov 21, 2020 at 9:43

in my case it was permission issue:

sudo chmod -R 0777 var/ pub/ generated/
sudo rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/*
sudo php bin/magento setup:di:compile

and it worked.

Your Answer

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

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