Post by labeshops » Mon Jul 18, 2016 7:42 pm

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?

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by pprmkr » Mon Jul 18, 2016 11:23 pm

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);

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by labeshops » Tue Jul 19, 2016 12:18 am

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.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » Thu Jul 21, 2016 3:36 am

Anyone have an idea on this one? It happened again this am and broke the stores.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by pprmkr » Thu Jul 21, 2016 1:25 pm

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.

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by labeshops » Thu Jul 21, 2016 7:27 pm

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.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by pprmkr » Thu Jul 21, 2016 7:54 pm

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

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by JNeuhoff » Thu Jul 21, 2016 8:39 pm

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.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by labeshops » Fri Jul 22, 2016 6:53 am

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.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » 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 :(

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by HansenDK » Tue Sep 04, 2018 5:24 pm

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

Newbie

Posts

Joined
Sun Nov 03, 2013 6:04 pm

Post by IP_CAM » Tue Sep 04, 2018 7:47 pm

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
---

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Qphoria » Fri May 24, 2019 5:20 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Fri May 24, 2019 5:21 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by oc-hastings » Mon Jul 29, 2019 8:34 pm

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.

New member

Posts

Joined
Fri Jan 16, 2015 10:58 pm

Post by icestudios » Wed Oct 02, 2019 12:08 am

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

Newbie

Posts

Joined
Fri Feb 15, 2013 6:14 am

Post by coolman1 » Tue Oct 29, 2019 7:49 pm

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

Newbie

Posts

Joined
Thu Dec 13, 2018 12:04 am

Post by tsloc » Fri Jan 17, 2020 12:01 am

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

New member

Posts

Joined
Thu Feb 09, 2017 7:15 am

Post by JNeuhoff » Fri Jan 17, 2020 12:42 am

@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.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by IP_CAM » Fri Jan 17, 2020 12:51 am

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:

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 19 guests