Just upgraded to 2.1.2 from 2.1.0. I tried to open one of my configurable products but I get this error message Cannot gather stats! Warning!stat(): stat failed for / I put the image into the location but it still won't open or see the file. The simple products associated with the configurable all pull their images fine.

  • this is becoming more widespread in my db. If I change the main photo of the configurable product, the same image for the associated products disappear and I get the message Cannot gather stats! Warning!stat(): stat failed for those associated products. – babywit Oct 20 '16 at 18:34
  • Also, I am not removing any image from pub/media folder or from anywhere else as mentioned in fix by @Devtype – babywit Oct 20 '16 at 18:44
  • just tried to delete products that were getting the Cannot gather stats message and upload them via csv. it broke both the front and back end with this message. 1 exception(s): Exception #0 (Magento\Framework\Exception\FileSystemException): Cannot write to the "/chroot/home/babywitc/test.babywit.com/html/pub/static/_requirejs/frontend/Babywit/Cool/en_US/requirejs-config.js" file. Unable to write ETC – babywit Oct 20 '16 at 20:59

I am experiencing this issue too. But I have figured one thing: Suppose that I have 4 simple products, all the 4 products are having same images. When I delete 1 image from a product, the other 3 products will display the error "Cannot gather stats! Warning!stat(): stat failed for". I've got this error in both 2.1.0 and 2.1.2. I think this should be a bug and Magento team should fix it ASAP!

  • Yes, I noticed that if I leave the image there and add second image in and change the base/thumbnail/swatch/main to the new image that it does not happen. – babywit Nov 5 '16 at 18:18

Not sure if this is at all helpful but I kept getting that message and being unable to edit my products which led to me deleting two of the broken products and reimporting them, which caused my site to go down in the front and backend, my host nexcess did a restore and noticed that my permissions had gone all wonky so they reset them and I have not seen this error again today. Hopefully this was all due to a permissions error?


Magento team already knows about this issue. They have already developed a solution for that, probably it will be released in next update. But if you really need solution here and now, then you can diff your the code in Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php with this, and update the function getImageJson() content.

  • I can't find a Catalog Folder in the vendor module folder except in the blank-theme folder and that Catalog folder only has a web folder with css in it. I am using 2.1.2 – babywit Nov 8 '16 at 17:45

If it helps anybody else, I can confirm with babywit, I reset pub and var permissions, and the error stopped ocuring.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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