Images Disppear after Flushing Image Storage Cache in Magento
Over the weekend we moved our website to a new server. We had our hosting provider do the migration over the weekend to minimise any disruptions and it all went fairly well.
The copy of the website was exactly the same as it was on the older server, which was all according to plan. We switched the name servers and the website was up and running. So far so good.
In our testing we found a few images here and there to be missing, so normally the thing to do is to flush the cache and reindex. That is when things started to turn for the worse!
After we flushed the image storage cache, we took a look at the site and all of the products had disappeared from the main page and as listings on the category pages. All we could see was the header, sidebar, breadcrumbs and pager. The rest of the page was empty and the footer was gone. We could still browse the product by the URL, which showed up everything as it should minus the image.
We spent hours disabling the cache, reindexing the data, making sure every folder has been migrated from the older server, checking that the images were still linked in each product. We Googled the issue and a potential solution was to disable all the products and then re-enable them, that didn’t work. I added a few new products with new images, that wasn’t showing any images either.
Tearing my hair out by this stage I pointing the nameservers back to the old server and once it replicated it was back to normal, although we still had a broken copy of the newer, faster, better server.
I decided to SSH into both servers and check the folder permissions. While in the \media\catalog\product directory I noticed that the older server had a \cache\ folder inside it and the new server didn’t. I thought this was a bit odd as the copy of the website on the new server should be exactly the same as the older one, and the only change we had made was that we flushed the image storage cache.
Another thing we noticed was when we compared the permissions between the two servers was that the older server was owned by a user “foodo” and group “nobody” whereas the new server was “foodo” and “foodo”.
By this stage it was fairly clear what the issue was – permissions. It turned out that when you “flush” the image storage cache it deletes the \cache\ folder inside \media\catalog\product\ . The next time the site is loaded it should start to regenerate the cache folder. Due to the permissions issue Magento could not recreate this folder, therefore the images were not being found by the front end and the page stopped loading, which is why the products were missing as well as the footer.
What I still don’t understand is even though we turned off all caching, we could still not see the product thumbs and main images.
Once we applied the permission changes (changed group to “nobody”), I pointed the name servers back to the new server. We flushed the cache again, reloaded the site and everything was back to normal. I also renamed the \cache\ directory to \cache1\ to make sure after we refreshed the site again, it recreated the directory.
It was a fairly stressful 24 hours, and as per usual asking questions on the Magento forums did nothing. Every time I have had an issue and posted on the forums, it has never been replied to.
Magento is such a great platform, though it is very bugging and the support isn’t that great. The community tries, but it is no WordPress. Whenever I recommend someone use Magento for their e-commerce needs I warn them to be prepared to rip their hair out at least 2-3 times a year. That is number 1 for
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.





Daniel:
I’m having a similar problem, and I’m 4 hours into my 24 hair-pulling session.
Forums have been of no help. I hope you can sympathize and possibly save me from stress death.
One day last week, all product and category images–including “image not found” image–we just gone. Poof. I did NOT migrate servers…or touch a thing. I wasn’t working on the site at the time.
If I right-click on the broken image icon, select “copy image url” and follow the path via http://FTP…the file is present, and the path is valid. I can download the file via FTP.
However, if I choose “ave image as”, I end up downloading a “corrupt” image file.
I am STUMPED…and just need someone to gift their time so I can fix this.
Can you help?
Thank you,
Michael
Hi Michael, sorry for the late reply. How did you go with this problem?
Daniel… You are a star! Thanks for this.
Hi Daniel,
Did you apply permission changes to whole directory e.g public_html and make it recursive? Or did you chown media/ media/catalog/ media/catalog/product?
We are having the same problem, no cache being generated and filed and fronted has same issues as you described.
Hi Dan, sorry for the late reply on this. Did you get it sorted out?
I have been trying to get this online store up and running. Everything was fine for MONTHS, then I woke up one to find that ALL the product images (200+) had disappeared on me. I did not do anything to cause this. I have tried to contact everyone I can think of (template help, host, etc…) and no one has given me a clear reason as to WHY, how to FIX or how to PREVENT this from happening again!
I need help!
http://nakeddavesmusic.com/store/
as you can see,the images are supposedly still \\\”there\\\”,but they are not showing. I tried chmod to 777,but that didnt fix anything.
Today I have had a similar issue. We have not moved servers I just updated the way images where displayed so I thought I would refresh the cache. Now only the main image and all thumbnails appear but the lightbox extension we have in our template shows the standard magento default image.
I have tried changing the owner etc but that did not seem to help out. Is there anything I should be looking for in particular?
p.s we are using Magento 1.5.1.0 if that changes anything.
Does the lightbox extension have its own cache?