Post by Evilonion » Wed Jan 03, 2018 9:47 pm

Warning: unlink(/var/sites/f/website.co.uk/storage/cache/cache.catalog.language.1514990162): No such file or directory in /var/sites/f/website.co.uk/public_html/newshop/system/library/cache/file.php on line 68

this is whats on line 68: unlink($file);

Any ideas how i can fix this?
Its filling up the error logs.

Everything seems to be set correctly in the config files after moving the storage folder so unsure what to do next?
Last edited by Evilonion on Fri Jan 05, 2018 10:20 pm, edited 2 times in total.

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by D3MO » Thu Jan 04, 2018 1:22 am

To me it looks like permission issue but reversed , when system not able to create cached file but since it had to create it tries to delete and do not finds it

Custom OpenCart Extension Development. Opencart Modification and third party Exetension debugging. Just PM me... or you can browse ready made extensions to boost your opencart website instantly


Active Member

Posts

Joined
Mon Apr 04, 2011 6:57 am


Post by straightlight » Thu Jan 04, 2018 8:10 am

Seem also to me that the library cache file may need to be replaced and also to clear your OC cache from the admin once the file being replaced. Replace your system/library/cache/file.php file with the following noticing if it will rectify the issue: https://github.com/opencart/opencart/bl ... e/file.php

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Evilonion » Thu Jan 04, 2018 7:57 pm

This appears to have cleared the error from appearing thank you.
Will update if i see it again.

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by Evilonion » Fri Jan 05, 2018 10:20 pm

Still receiving error in Logs and it occasionally comes up on the front end as an error message across the screen.
Firstly, any ideas how to fix? and secondly is there a way to stop these messages showing to customers?

2018-01-05 14:00:33 - PHP Warning: unlink(/var/sites/f/website.co.uk/storage/cache/cache.catalog.language.1515164407): No such file or directory in /var/sites/f/website.co.uk/public_html/system/library/cache/file.php on line 44

Also:


2018-01-05 11:41:55 - PHP Warning: unlink(/var/sites/f/firesidefabrics.co.uk/storage/cache/cache.manufacturer.0.1515152492): No such file or directory in /var/sites/f/firesidefabrics.co.uk/public_html/system/library/cache/file.php on line 44


Error logs are absolutely full of these errors constantly repeating

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by straightlight » Sat Jan 06, 2018 6:30 am

Now that you've replaced the cache library file, clear your OC admin dashboard cache as well from your admin - > extensions - > modifications - > refresh button. Does the error log keep increasing afterwards?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Evilonion » Sat Jan 06, 2018 8:19 pm

error still persists.
error message that occasionally pops up in admin above that error is "syntax error: unexpected token < in JSON at position 0

OK

unlink(/var/sites/f/website.co.uk/storage/cache/cache.catalog.language.1515230665): No such file or directory in /var/sites/f/website.co.uk/public_html/system/library/cache/file.php on line 44

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by straightlight » Sat Jan 06, 2018 10:03 pm

error message that occasionally pops up in admin above that error is "syntax error: unexpected token < in JSON at position 0
Where in the admin do you see this message and how?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Evilonion » Sun Jan 07, 2018 9:32 pm

this particular message popped up when editing an order.

the php error however shows up all over the place in admin in various places such as editing products, adding products, viewing products on the main site all sorts. seems to be a continuous error with that particular file.php

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by straightlight » Sun Jan 07, 2018 9:41 pm

If you add the following line in your system/library/cache/file.php after the <?php line:

Code: Select all

echo 'test123';
do you see the line added on the top of your browser after saving the file?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Evilonion » Mon Jan 08, 2018 1:43 am

instantly throws up an error and both admin and storefront don't load:

Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in /var/sites/f/website.co.uk/public_html/system/library/cache/file.php on line 3

removed that line you said and when i click on dashboard i got this error:

SyntaxError: JSON Parse error: Unrecognized token '<'
OK
<b>Warning</b>: unlink(/var/sites/f/website.co.uk/storage/cache/cache.manufacturer.0.1515346921): No such file or directory in <b>/var/sites/f/website.co.uk/public_html/system/library/cache/file.php</b> on line <b>44</b>{"ie":{"total":"1","amount":"\u00a374.00"},"gb":{"total":"10","amount":"\u00a397.04"}}

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by ADD Creative » Mon Jan 08, 2018 8:30 pm

You can switch off the displaying of errors by going to System -> Settings -> Edit (for your store) in the Admin. Then on the Server tab set Display Errors to No and save. This will stop the errors from showing on pages (and causing other errors), but they will still be logged.

When you see the errors have you check that the file it's trying to delete is actually deleted?

www.add-creative.co.uk


Active Member

Posts

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

Post by Evilonion » Mon Jan 08, 2018 8:52 pm

i have the error notification switched off but the error that still shows is a pop up that the user has to click ok to close.

as for the file, i don't know what file its trying to delete?

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by ADD Creative » Tue Jan 09, 2018 2:58 am

The files being deleted are in brackets after unlink in your error messages.

For example in the last error message you posted.

Code: Select all

<b>Warning</b>: unlink(/var/sites/f/website.co.uk/storage/cache/cache.manufacturer.0.1515346921): No such file or directory in <b>/var/sites/f/website.co.uk/public_html/system/library/cache/file.php</b> on line <b>44</b>
/var/sites/f/website.co.uk/storage/cache/cache.manufacturer.0.1515346921 is the file being deleted.

Regarding the displaying of errors. It seems that version 3 has an seperate default error handler. To switch this off change $_['error_display'] to false in system\config\default.php or add

Code: Select all

$_['error_display']        = false;
to system\config\catalog.php and system\config\admin.php

www.add-creative.co.uk


Active Member

Posts

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

Post by straightlight » Tue Jan 09, 2018 7:29 am

This ongoing issue has been posted on Github yesterday. Thank you.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Evilonion » Tue Jan 09, 2018 7:52 am

the file in the brackets doesn't exist. the one that does is: cache.manufacturer.0.1515457091
slightly different numbers...


And the language file is: cache.catalog.language.1515458969

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by ADD Creative » Tue Jan 09, 2018 9:00 pm

That shows that the file is being deleted correctly. Once you have switched off display errors, to stop your log files filling up you could change the following in system/library/cache/file.php.

Code: Select all

if (file_exists($file)) {
	unlink($file);
}
To

Code: Select all

if (is_file($file)) {
	@unlink($file);
}
This won't help help solve the root cause of the problem of why you see so many race conditions in deleting the cache files.

www.add-creative.co.uk


Active Member

Posts

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

Post by Evilonion » Wed Jan 10, 2018 1:58 am

I thought id try turning off cache to see what happens.

Warning: fopen(/var/sites/f/website.co.uk/storage/logs/): failed to open stream: Is a directory in /var/sites/f/website.co.uk/public_html/system/library/log.php on line 22
That appeared once and haven't been able to see it again.

Im getting loads of this unlink error though, every file it refers to doesn't even exist.
I don't really want to hide it from the logs as id be unsure if it was still happening then...

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by ADD Creative » Wed Jan 10, 2018 2:45 am

What is usually happening in this case is another process has deleted the cache file between the file_exists($file) check and the unlink($file). So there ends up being no file for unlink($file) to delete, giving the error message. You could try clearing the file status cache instead of suppressing the error.

system/library/cache/file.php.

Code: Select all

if (file_exists($file)) {
	unlink($file);
}
Change to

Code: Select all

clearstatcache(false, $file);

if (is_file($file)) {
	unlink($file);
}

www.add-creative.co.uk


Active Member

Posts

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

Post by rokonkwo » Wed Jan 10, 2018 8:17 am

It did not work. Is there any solution to this error?

Newbie

Posts

Joined
Sat Dec 09, 2017 11:43 am
Who is online

Users browsing this forum: No registered users and 11 guests