Jump to content

Cache Data Not Written Error


SMKSpares

Recommended Posts

Hello everyone,

 

I'm still in the process of adding products to my store, after a little break I returned the other day and got the below error:

Warning: Cache data not written. in /home/vu0p3swpv8is/public_html/classes/cache/file.class.php on line 269

After spending sometime looking I cannot find anything close to solving my problem, line 269 refers to:

trigger_error('Cache data not written.', E_USER_WARNING);

I haven't done any updates or alterations to any files and when I try to log into my admin, a blank page appears.

I'm currently running CubeCart 6.25 and this is my only installation.

Thanks in advance.

 

Link to comment
Share on other sites

Thank you for your reply, I have solved the problem, it seems I had gone over my file limit, not sure how though. I deleted my trash folder and now I can log in etc.

When I was talking to my hosts support, they said I have too many files in my public_html/cache folder and I need to delete the ones that are no longer needed but how do I know which will be needed and which won't?

Thanks again in advance.

Link to comment
Share on other sites

We have come across a few instances of a CubeCart installation having many thousands of files in the /cache/ folder. I think we have not yet found why that is. CubeCart does not actually generate that many cache files (a few hundred?), and for any exactly composed contents (such as a SQL query), if the cache file is older than 24 hours, it gets replaced. And if a file is to be read from the cache, but it doesn't exist, CubeCart will create a new one.

As of (if I recall) CC624, CubeCart no longer does an automatic clearing of the cache after each and every POSTing from admin. Now, there is a lit button at the upper-right that says the cache needs to be cleared -- but its not necessary unless you need to check on something on the storefront right away, or until you are finished with your administrative tasks.

The problems with having many thousands of files in /cache/ is that deleting them (PHP's unset) takes longer than the time limit PHP is allowed to run - which thus crashes PHP, and those not familiar with server operations become flustered.

Someone will come along shortly who is very experienced with server/hosting operations who may have a better idea why some hosting environments cause many thousands of files in /cache/.

 

Link to comment
Share on other sites

6 hours ago, bsmither said:

You may wish to consult with your hosting provider to determine if REDIS or MEMCACHED is available.

Sounds like a pretty cheap hosting plan that is restricting the number of inodes (effectively number of files) to a low number and if they are doing that, they are probably restricting a good number of other things (all while probably claiming it is "unlimited" hosting !).  Worth checking but VERY unlikely that a hosting company like that will have memcached and certainly not REDIS installed and available but both of those would certainly solve the problem (and speed the website up !)

Link to comment
Share on other sites

Well, it seems we still don't know why there can be many thousands of files in /cache/.

As mentioned in this issue posted in the Github (https://github.com/cubecart/v6/issues/2051), you may wish to view the Search Terms tab in admin, Statistics. That report does not show the total number of unique search terms logged, but the pagination numbers (seen just above the list) should give a clue: if the highest page number is very large, then we may think that your site is getting hit hard with random search terms.

There are many queries that CubeCart makes, but the total number is reasonably well limited. The only query that the CubeCart code has no control over is a search query.

The pertinent part of the name of the file in the cache is an MD5 hash of the actual query string.

Link to comment
Share on other sites

Thank you for your replies, I'm using GoDaddy after it was recommended to me, I used to use Site5 and they were brilliant but now only have hosting in the USA and I'm in the UK (when maintenance was done, it was done during the night where the servers were based).

There is a 250,000 file limit, after deleting the recycle bin, this bought it down to around 240,000 but I suspect there may be some other shopping cart files still lurking about as I did find some a while ago which I deleted even though they should have been deleted through cpanel!

I did notice the 'Clear Cache' button after a while as I couldn't understand why updates were not showing on setting up my shop!

I would like to apologise for not getting back to you sooner but I'm not getting notifications.

Link to comment
Share on other sites

250,000 is a reasonable number and should be fine for most users so you must have a very large number of files somewhere in your hosting account - is your hosting company not able to help and tell you where these are or are they saying that the cache directory is holding all of these ?  Have you asked them if memcached is available ?  If there really is (probably) more than 200,000 files in the cache directory, then there is a major problem somewhere

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...