Post by baud13 » Sun Jan 23, 2022 10:59 pm

Hi all,

I am running oc 3.0.3.2 with Journal 3 and I get this error at the bottom of my product page. I see this error from time to time. Once I refresh the page it's gone. Also, i cannot reproduce the error somehow, I just see it sometimes there. Can anyone help me with this issue?

the warning is as such:

warning: unlink(/var/www/vhosts/*******/*******/system/storage/cache.catalog.language.1231364664): No such file or directory in /var/www/vhosts/********/*******/system/library/cache/file.php online 68


line 68 of file.php is as such:

public function delete($key) {
$files = glob(DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.*');

if ($files) {
foreach ($files as $file) {
if (file_exists($file)) {
line 68---->> unlink($file);
}
}
}
}
}


Thank you very much!
Georgia

Newbie

Posts

Joined
Sun Jan 23, 2022 9:20 pm

Post by ADD Creative » Mon Jan 24, 2022 2:43 am

Try this fix. https://github.com/opencart/opencart/co ... 990171168e

Once you have fixed it, you need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, like you have found, it can also be a security risk.

1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.

2. In system/config/default.php set error_display to false.

3. In your OpenCart Setting on the server tab set Display Errors to No.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by hpwebdesign » Mon Jan 24, 2022 8:09 am

you can add ocmod like this to fix error

Code: Select all

<file path="system/library/cache/file.php">
  		<operation error="skip">
            <search trim="true"><![CDATA[unlink($file);]]></search>
              <add position="replace"><![CDATA[@unlink($file);]]></add>
        </operation>
	</file>

HP Web Design
http://hpwebdesign.io
Opencart Extension Development | OpenCart Professional Services | OpenCart Tutorials


User avatar
New member

Posts

Joined
Wed Aug 15, 2018 6:58 am
Location - Yogyakarta

Post by ADD Creative » Mon Jan 24, 2022 7:09 pm

hpwebdesign wrote:
Mon Jan 24, 2022 8:09 am
you can add ocmod like this to fix error

Code: Select all

<file path="system/library/cache/file.php">
  		<operation error="skip">
            <search trim="true"><![CDATA[unlink($file);]]></search>
              <add position="replace"><![CDATA[@unlink($file);]]></add>
        </operation>
	</file>
That doesn't fix the issue, just hides it. The problem is language was trying to read the 'language' cache, but writing the 'catalog.language' cache. This will cause the cache to be written on every request, greatly increasing the chance of a race condition.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 28 guests