TransWikia.com

Magento Site Layout Breaks Once a Day - Emptying Var/Cache Fixes

Magento Asked by Brandon MAC on February 11, 2021

One of my client’s websites on Magento 1.9.2.3 has been experiencing a strange error once every day (at random times).

Where the site is loaded without any graphical styling no images, no CSS, javascript or CMS Page content.

The site is only loading the header links (cart, account, login) Category navigational links (links to site product categories), and some footer links (advanced search, sitemap, etc.) – all in the default blue unordered list format. However, the site is loading static block content (although again without any styling, but the content is there).

On CMS pages, the follow error message also appears among the links:

"There was no 404 CMS page configured or found"

Each time this occurs, the site can be restored to normal upon deleting the contents of the var/cache directory – then the site loads perfect again… until it happens again.

I am including a screenshot of how the site loads below.

Image of Site Error

My best diagnosis of the error thus far has fallen on the LAYOUT_GENERAL_CACHE_TAG Magento cache as I have noticed that this showing invalidated when the site goes down like pictured above. It is almost like the site is having trouble loading CMS and theme content on occasion.

A few notes on our setup:

  • Dedicated cloud server
  • 4 Magento sites total (all on the same version & theme), but only one with this error
  • No CDN in place

Any help is greatly appreciated, I am at my wits end trying to debug what is going on. It is such an easy fix to empty var/cache and bring the site to normal, but doing this everyday is getting overwhelming.

Thank you!

UPDATE:
After looking into the issue further, I noticed in the developer console in Chrome that the site is attempting to load js and css with the incorrect file paths.

For example: It is attempting to load css without the preceding “skin” directory and js without the preceding “js” directory. (i.e. https://domainname.com/frontend/base/default/css/style.css)

UPDATE 2:
I took another look at the rendered page when the site was down and it appears that the site is not loading any configuration properly when it goes down (no CMS content is being loaded on the page, the base urls for css & js filepaths are loaded incorrectly). Although every time the site breaks, a simple clearing of var/cache returns the site to normal.

Notes on What I have Checked

  • Correct File permissions for system files/folders
  • Correct base secure & unsecure urls
  • Correct base file paths for css and js
  • Restarted Memcached
  • Cleared Merged CSS & JS files
  • No errors in layout.xml

One Answer

After some thorough digging, I found the problem to lie with the Magento configuration cache. Disabling this cache via the Magento backend fixed the problem. I found another with a similar issue here:

Magento site is frequently getting CACHE issue and failing to serve CSS, site is getting broken page

https://github.com/AmpersandHQ/magento-ce-ee-config-corruption-bug

Answered by Brandon MAC on February 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP