Page 1 of 2

[SOLVED] - Checked.cache getting huge and killing the stores

Posted: Mon Jul 18, 2016 7:42 pm
by labeshops
Since upgrading to 2.2 I have noticed that vqmod/checked.cache.php gets HUGE now and then and crashes my stores. I get memory exhausted error in backend. This am it was over 8,000,000 and caused the error.

This file was not part of vqmod in 1.5 so I don't know what it does? Is there a way to disable it or auto clear it every day?

Re: Checked.cache getting huge and killing the stores

Posted: Mon Jul 18, 2016 11:23 pm
by pprmkr
vQmod should clear cache on every rebuild.
Line 251 of vqmod.php:

Code: Select all

		// Clear checked cache if rebuilding
		file_put_contents(self::path(self::$checkedCache, true), '', LOCK_EX);

Re: Checked.cache getting huge and killing the stores

Posted: Tue Jul 19, 2016 12:18 am
by labeshops
pprmkr wrote:vQmod should clear cache on every rebuild.
Line 251 of vqmod.php:

Code: Select all

		// Clear checked cache if rebuilding
		file_put_contents(self::path(self::$checkedCache, true), '', LOCK_EX);
Rebuild meaning when I clear and refresh via the modifications menu? Thought that was just for ocmod???

I did rebuild a lot as I was getting things set up, but now that they are, haven't changed anything in a week or more.

Re: Checked.cache getting huge and killing the stores

Posted: Thu Jul 21, 2016 3:36 am
by labeshops
Anyone have an idea on this one? It happened again this am and broke the stores.

Re: Checked.cache getting huge and killing the stores

Posted: Thu Jul 21, 2016 1:25 pm
by pprmkr
When new xml added or a file is changed, vQmod does all modifications and clears checked.cache by writing an empty ''

When you checked.cache keeps growing, it is possible that at the moment script want to write '', file is locked due to other process writing.

Perhaps adding extra code helps? Try getting return value of file_put_contents at line 251 of /vqmod/vqmod.php:

Code: Select all

$cache_cleared = file_put_contents(self::path(self::$checkedCache, true), '', LOCK_EX);

if ($cache_cleared === false) {
  // do it again?
 // or log it 
}
To reset vqmod, delete checked.cache, mods.cache and contents of folder vqcache and logs.
Then browse your website to force vqmod to rewrite all modifications
When all modifications are written, check and remember the size of cache files.

After a while check the size again.

Re: Checked.cache getting huge and killing the stores

Posted: Thu Jul 21, 2016 7:27 pm
by labeshops
pprmkr wrote:When new xml added or a file is changed, vQmod does all modifications and clears checked.cache by writing an empty ''

When you checked.cache keeps growing, it is possible that at the moment script want to write '', file is locked due to other process writing.

Perhaps adding extra code helps? Try getting return value of file_put_contents at line 251 of /vqmod/vqmod.php:

Code: Select all

$cache_cleared = file_put_contents(self::path(self::$checkedCache, true), '', LOCK_EX);

if ($cache_cleared === false) {
  // do it again?
 // or log it 
}
To reset vqmod, delete checked.cache, mods.cache and contents of folder vqcache and logs.
Then browse your website to force vqmod to rewrite all modifications
When all modifications are written, check and remember the size of cache files.

After a while check the size again.
Where exactly should I put that code? line 251 is a } the close of

Code: Select all

		if(file_exists($cacheFile) && filemtime($cacheFile) >= self::$_lastModifiedTime && filemtime($cacheFile) >= $file_last_modified) {

			return $cacheFile;

		}
Should I try your code before or after this???

I tried putting it after it and it caused my store fronts to be a blank white page so have removed it again.

Re: Checked.cache getting huge and killing the stores

Posted: Thu Jul 21, 2016 7:54 pm
by pprmkr
I have version 2.5.1 installed.
The code you show is from older version, perhaps 2.3.2 ?

I suggest you uninstall this version and get 2.5.1 or try the latest 2.6.1

Re: Checked.cache getting huge and killing the stores

Posted: Thu Jul 21, 2016 8:39 pm
by JNeuhoff
labeshops wrote:
Rebuild meaning when I clear and refresh via the modifications menu? Thought that was just for ocmod???

I did rebuild a lot as I was getting things set up, but now that they are, haven't changed anything in a week or more.
If you use VQmod from https://github.com/vqmod/vqmod/releases then its vqmod/vqcache/* or its vqmod/*.cache files are not refreshed by a Extensions > Modifications > Refresh, the latter is only for OCmod. If your problem still persists after upgrading to the latest VQmod, you could try the Integrated VQmod which is basically OCmod with added VQmod XML syntax support, the latter doesn't use the vqmod/vqcache/* nor vqmod/*.cache and works more like OCmod.

Re: Checked.cache getting huge and killing the stores

Posted: Fri Jul 22, 2016 6:53 am
by labeshops
JNeuhoff wrote:
labeshops wrote:
Rebuild meaning when I clear and refresh via the modifications menu? Thought that was just for ocmod???

I did rebuild a lot as I was getting things set up, but now that they are, haven't changed anything in a week or more.
If you use VQmod from https://github.com/vqmod/vqmod/releases then its vqmod/vqcache/* or its vqmod/*.cache files are not refreshed by a Extensions > Modifications > Refresh, the latter is only for OCmod. If your problem still persists after upgrading to the latest VQmod, you could try the Integrated VQmod which is basically OCmod with added VQmod XML syntax support, the latter doesn't use the vqmod/vqcache/* nor vqmod/*.cache and works more like OCmod.
It is the latest version. says

Code: Select all

abstract class VQMod {
	public static $_vqversion = '2.6.1';	
in my vqmod.php file

Not sure what the integrated vqmod is but I'm not fond of ocmod - cannot figure out how to easily modify things like I can in vqmod, so would rather use vqmod.

What is checked.cache anyway? Seems like it just gets huge very, very fast.

Re: Checked.cache getting huge and killing the stores

Posted: Sun Jul 24, 2016 7:23 pm
by labeshops
I know nothing about cron jobs, but is there some way I can set up something like that to delete the checked.cache every few hours? My sites died again over night due to it being huge again :(

Re: Checked.cache getting huge and killing the stores

Posted: Tue Sep 04, 2018 5:24 pm
by HansenDK
labeshops wrote:
Sun Jul 24, 2016 7:23 pm
I know nothing about cron jobs, but is there some way I can set up something like that to delete the checked.cache every few hours? My sites died again over night due to it being huge again :(
Hi Labeshops, Did you ever find a solution for this, other than deleting the file every time the shop is down ? I have the same problem

Re: Checked.cache getting huge and killing the stores

Posted: Tue Sep 04, 2018 7:47 pm
by IP_CAM
Well, one could try MaxD's famous VqMod Pro Version 2.61, it handles a few things in a different way, by
automatically cleaning out and 'renewing' the cached file Content after a 'given' time, similar to a cron job.
(Wich seldom leads to a NOT FOUND Error, when playing around in Admin, and something tries to link
some Code, wich no longer exists, during such a Cache Clean Function Process, just to have it mentiond.
But it happen very seldom, and only happen one Pageload long, then, everything works again !)

Code: Select all

if (!file_exists(substr(DIR_SYSTEM,0,-7).'vqmod/pro.cache') || filemtime(substr(DIR_SYSTEM,0,-7).'vqmod/pro.cache') < time() - 180) { 
One only needs to RENAME the default OC system/helper/json.php file first, OR it will be overwritten,
if VqMod Pro is installed. There is no install process, since this will be done automatically as well.
I had great success by use of that Extension for my v.1.5.6.5_rc, and I assume, that it will function in later
OC Versions as well. And if not, scrap it, and use the default json.php file again. :D And it works, combined
with my VqMod/OcMod-Installation on ipcam.li, so, OcMod itself should not be a problem, at best, some linkings, if so ...
Just figured ...
Ernie
--
PS: Still, it would be helpful, to see into one of those giant sized cache-temp-files, to find out, what it
contains on links ... ;)
---
download/file.php?mode=view&id=35508
---

Re: Checked.cache getting huge and killing the stores

Posted: Fri May 24, 2019 5:20 am
by Qphoria
So the issue is with the new push from the admin to move the "storage" folder out of the public_html folder.
This isn't a bad idea for files, but isn't really needed for modification files but they are lumped underneath storage.
vqmod can't cache files in a directory higher than itself so it regenerates them every time. But note, this is only for files that are being ocmodded first and then being vqmodded... so it's relatively harmless unless you have a ton of ocmods and vqmods altering the same files.

A quick fix is after moving the storage to a higher level area, update the config.php and admin/config.php files to change

Code: Select all

define('DIR_MODIFICATION', DIR_STORAGE . 'modification/')
to

Code: Select all

define('DIR_MODIFICATION', DIR_SYSTEM . 'modification/')
That will keep the modifications folder under the parent directory and fix the issue

Re: Checked.cache getting huge and killing the stores

Posted: Fri May 24, 2019 5:21 am
by Qphoria
So the issue is with the new push from the admin to move the "storage" folder out of the public_html folder.
This isn't a bad idea for upload and download files, but isn't really needed for modification files but they are lumped underneath storage.
vqmod can't cache files in a directory higher than itself so it regenerates them every time. But note, this is only for files that are being ocmodded first and then being vqmodded... so it's relatively harmless unless you have a ton of ocmods and vqmods altering the same files.

A quick fix is after moving the storage to a higher level area, update the config.php and admin/config.php files to change

Code: Select all

define('DIR_MODIFICATION', DIR_STORAGE . 'modification/')
to

Code: Select all

define('DIR_MODIFICATION', DIR_SYSTEM . 'modification/')
That will keep only the modifications folder under the system directory and fix the issue

Re: Checked.cache getting huge and killing the stores

Posted: Mon Jul 29, 2019 8:34 pm
by oc-hastings
Thanks Qphoria

This looks hopeful. Our checked.cache reached 60MB and took down the site.

I have located the /config.php and admin/config.php files but I'm not sure what you mean by '... after moving the storage to a higher level area..'?

Thanks for your help.

Re: Checked.cache getting huge and killing the stores

Posted: Wed Oct 02, 2019 12:08 am
by icestudios
Hi Qphoria,

When making the above change "define('DIR_MODIFICATION', DIR_SYSTEM . 'modification/')" in both config files, should the contents of the existing 'storage/modification' folder be copied to the 'system/modification' folder, or will everything be re-created when Modifications is refreshed within OC admin panel?

Many thanks

OC Version 3.0.3.2
Vqmod 2.6.4

Re: Checked.cache getting huge and killing the stores

Posted: Tue Oct 29, 2019 7:49 pm
by coolman1
Hello

i had the same problem

i just empty the file checked.cache and insert to the file checked.cache in the first line this " system/startup.php" and its work great for me.

i hope this will be helpful



OC Version 3.0.3.2
Vqmod 2.6.4

Re: Checked.cache getting huge and killing the stores

Posted: Fri Jan 17, 2020 12:01 am
by tsloc
Dear forum firends,

I need to bump this thread. I have discovered the same problem with my shop. 500 server status after the checked.cache file gets around 30MB big.

I have read about the "Integrated vqmod" but I will ask you guys if coolman1´s solution is the best one? It sounds quite easy and nice to get rid of the constantly growing cache file that I need to remove a couple of times every week, otherwise the shop goes down.

I`m using OC 3.0.3.2
vqmod 2.6.2 (my file name was 2.6.3 but the version details in vqmod.php says 2.6.2)


Best regards,
Thomas

Re: Checked.cache getting huge and killing the stores

Posted: Fri Jan 17, 2020 12:42 am
by JNeuhoff
@tsloc: Qphoria's suggestion should work if you continue to use his VQmod. Or, you could use the Integrated VQmod which doesn't use the 'vqmod/vqcache' and hence won't have this issue. Your suggestion of merely deleting the 'vqmod/vqcache' is only a temporary solution.

Re: Checked.cache getting huge and killing the stores

Posted: Fri Jan 17, 2020 12:51 am
by IP_CAM
Well, some OC Users just don't want to understand, that using (regular) VqMod
and OcMod combined is to most unprofessional way, to run OC. And if one more
such Extension would exist, the Fellows would add that one too. It just proves,
how little Knowledge exists, and how little Engagement, to do things right.
They could easy find out, but they only come here, if they run into Problems,
but they don't waste time, to read about it and get smart, because it has been
replied to already in several Places around here.
Like using the Integrated VQmod which would solve those problems for
good, if they need to use VqMods, because some VqMod Creators where too lazy
to do their Job right. Ignorance, just plain Ignorance, whereever one looks ...

No wonder, that most won't succeed, and then blame it on something else ... :laugh: