Post by marius-ciclistu » Tue Jan 16, 2018 5:31 pm

Hi,
Can anyone tell me a solution to the below warning?

[13-Jan-2018 15:47:50 Europe/Bucharest] PHP Warning: unlink(.../system/storage/cache/cache.currency.1515849832): No such file or directory in .../system/library/cache/file.php on line 17

Opencart 2.3.0.2

Thank you.

New member

Posts

Joined
Sat Nov 24, 2012 6:22 am

Post by marius-ciclistu » Tue Jan 16, 2018 6:21 pm

Ant that function is

Code: Select all

	public function __construct($expire = 3600) {
		$this->expire = $expire;

		$files = glob(DIR_CACHE . 'cache.*');

		if ($files) {
			foreach ($files as $file) {
				$time = substr(strrchr($file, '.'), 1);

				if ($time < time()) {
					if (file_exists($file)) {
						unlink($file);
					}
				}
			}
		}
	}

New member

Posts

Joined
Sat Nov 24, 2012 6:22 am

Post by Johnathan » Tue Jan 16, 2018 11:29 pm

This error generally just means OpenCart is trying to delete a cache file that has already been deleted (so it no longer exists). It sometimes happens when you have a lot of concurrent connections, so two "delete" commands happen at the same time. It's usually nothing to be concerned about, you can ignore it.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by marius-ciclistu » Tue Jan 16, 2018 11:35 pm

Thank you. How can I make it not show with @ simbol? I like a clean log.

EDIT
Solution
@unlink($file);

New member

Posts

Joined
Sat Nov 24, 2012 6:22 am

Post by paulfeakins » Wed Jan 17, 2018 1:26 am

marius-ciclistu wrote:
Tue Jan 16, 2018 11:35 pm
Thank you. How can I make it not show with @ simbol? I like a clean log.
Fairly early on in my software development career I once asked a more senior developer how I should hide errors. "Fix your code!" was his reply that I never forgot ;)

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by marius-ciclistu » Wed Jan 17, 2018 1:34 am

Thank you but I solved it with @ and it is not an error. It's a warning that can't be fixed in busy websites that have a lot of concurent conections.

New member

Posts

Joined
Sat Nov 24, 2012 6:22 am

Post by Johnathan » Wed Jan 17, 2018 11:31 pm

Yeah, Daniel should probably fix it in the OpenCart code, but hiding it with @ is an acceptable solution.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by oberheimer » Thu Mar 28, 2019 6:02 pm

I got the same error but it was caused by a new module. I have to fix the module I guess

New member

Posts

Joined
Fri Jun 22, 2012 5:28 am
Who is online

Users browsing this forum: No registered users and 218 guests