Jump to content
Sign in to follow this  
SMKSpares

Cache Data Not Written Error

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.

 

Share this post


Link to post
Share on other sites

Welcome SMKSpares! Glad to see you made it to the forums.

Let's start by having you create the error log. Let's see if there are any other events that is preventing CubeCart from being able to write to its /cache/ folder.

 

Share this post


Link to post
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.

Share this post


Link to post
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/.

 

Share this post


Link to post
Share on other sites
Posted (edited)

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

Edited by bsmither

Share this post


Link to post
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 !)

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

If you clear cache does that process complete OK or do you get a white screen / error and if nothing obvious are you able to validate that the cache directory is then empty ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...