17

I'm doing migration process from Magento 1.9.2.4 to Magento 2.1.6, after migration completed, I move media folder of M1 to pub/media M2.

Now the problem is some of the images doesn't generate in catalog/Cache folder

For example below images are goes to 404 not found

pub/media/catalog/product/cache/f9c7fbe9b524c081a3ccf800cbd963eb/m/s/msj006c-red_2.jpg
pub/media/catalog/product/cache/75eed2686e01eb22cb4050b2f40ddf97/m/s/msj006c-red_2.jpg
pub/media/catalog/product/cache/f9c7fbe9b524c081a3ccf800cbd963eb/m/s/msj006c-red_2.jpg

I did like simply delete the catalog cache folder and load the page again but still it goes to broken image.

My page have 50% of broken images

enter image description here

can share the workaround to fix this issue?

21

You should try using the image resize command to pre-generate all necessary resizes.

php bin/magento catalog:image:resize

This command gets all the images sizes that have been defined in the theme XML and pregenerates the images in their correct folders.

You can also check the command documentation for more information http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-images.html

  • 1
    FYI - this command takes absolutely forever to run on a store of any size. We saw upwards of 17hrs on a recent run. On other occasions, it needed to be run over a weekend. See: github.com/magento/magento2/issues/8145 – Leland Dec 3 '18 at 17:03
0

I also had this issue and even command line images generation mentioned above did not work. It seems Magento is caching the information that thumbnail is created and even standard Magento cache cleaning (both command line or admin panel) doesn't remove this information from cache.

I removed all cache directories contents manually and it helped:

rm -Rf var/cache/*
rm -Rf var/page_cache/*

.. and so on. Then images thumbnails should generate properly "on demand" while browsing the site.

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.