I've two instance of magento, both the source code are the same, because of instance 1 DB is corrupted, i copy the instance 2 db to replace instance 1, after that the website of instance 1 images cache is not generating correctly for example,
In the product details page, the image cache show the following link: http://example.com/media/catalog/product/cache/9c7478ef2dd1321ee5c373d7121355a1/j/a/example_a11-0828.jpg
but the actual "9c7478ef2dd1321ee5c373d7121355a1" folder does not exist in /pub/media/catalog/product/cache, but the image actually exist in 9f6f32f83a91f8036df18f8d1ffe4bea folder,
anyone know how to fix it? i've tried to run bin/magento catalog:image:resize, it can't solve the problem.
1 Answer 1
Can you elaborate on how bin/magento catalog:image:resize does not fix your problem? My understanding is that this command will re-save your product images to the cache (for multiple sizes) - which seems to be the issue you're describing.
This command does usually take quite a long time to run, depending on your catalog size. Did you run this command to completion? Did you receive any errors in var/log/exception.log or /var/log/system.log`?
Do the actual image files exist on the instance 1 server? To re-save the images into the cache, the actual image files defined for each product must exist on the server first.
-
bin/magento catalog:image:resize still gen wrong cache folder name that does not match the image url on frontend, i had re-uploaded all products image to instance 1 from instance 2.hkguile– hkguile2022年10月26日 09:05:36 +00:00Commented Oct 26, 2022 at 9:05
-
bin/magento catalog:image:resizewill always generate a new, unique cache hash. If the image URLs you are loading on the frontend of your site do not match the newly generated cache hashes - there's an issue with how you are loading the image URLs for these products. What does the code to load your product image URLs look like?Liam Toohey– Liam Toohey2022年10月27日 13:12:14 +00:00Commented Oct 27, 2022 at 13:12