Post by straightlight » Wed Jan 10, 2018 8:38 am

It seem this error message has been showing quite enough now. Let's troubleshoot this issue with my theory of this story. In system/library/cache/file.php file,

find all instances of:

Code: Select all

if (file_exists($file)) {
replace with:

Code: Select all

if (file_exists($file) && ($fp = fopen($file, "rb")) !== false) {

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by Evilonion » Wed Jan 10, 2018 5:04 pm

is this as well as the previous code change?
Ive just implemented the change listed before...

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by straightlight » Wed Jan 10, 2018 6:18 pm

Correct. Follow this post: viewtopic.php?f=202&t=200896#p709385 and apply the changes from my previous post above in addition.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by Evilonion » Wed Jan 10, 2018 6:30 pm

the github file is totally different to the original file and the code you have quoted isn't there.

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by straightlight » Wed Jan 10, 2018 6:37 pm

Right. From the Github file you have replaced,

find:

Code: Select all

if ($files) {
			foreach ($files as $file) {
				$filename = basename($file);
				$time = substr(strrchr($file, '.'), 1);
				if ($time < time()) {
					$this->delete(substr($filename, 6, strrpos($filename, '.') - 6));
				}
			}
		}
				
replace with:

Code: Select all

if (is_resource($files)) {
			foreach ($files as $file) {
			    $filename = basename($file);
				    
			    if (file_exists($filename) && ($fp = fopen($filename, "rb")) !== false) {				    
    			        $time = substr(strrchr($file, '.'), 1);
    				    
			        if ($time < time()) {
					$this->delete(substr($filename, 6, strrpos($filename, '.') - 6));
			       }
			  }
			}
		}

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Wed Jan 10, 2018 6:58 pm

Have you switch off Display Errors by going to System -> Settings -> Edit (for your store) -> Server (tab)?

If you are using version 3. Have you switched off displaying of errors in the config files? 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


Expert Member

Posts

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

Post by Evilonion » Wed Jan 10, 2018 8:15 pm

The above code changes to file.php have not worked. i added them when you posted and have had several errors since.
I cleared cache etc when changes were made.

2018-01-10 12:13:33 - PHP Warning: unlink(/var/sites/f/website.co.uk/storage/cache/cache.catalog.language.1515589999): No such file or directory in /var/sites/f/website.co.uk/public_html/system/library/cache/file.php on line 48

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by Evilonion » Wed Jan 10, 2018 8:16 pm

ADD Creative wrote:
Wed Jan 10, 2018 6:58 pm
Have you switch off Display Errors by going to System -> Settings -> Edit (for your store) -> Server (tab)?

If you are using version 3. Have you switched off displaying of errors in the config files? 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

i will make these changes now.

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by straightlight » Thu Jan 11, 2018 7:23 am

Has the provided codes above resolved the issue?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by Evilonion » Thu Jan 11, 2018 4:10 pm

unfortunately not, quite a few this morning. (error reporting front end stopped though thankfully)

2018-01-11 7:54:33 - PHP Warning: unlink...public_html/system/library/cache/file.php on line 48

Active Member

Posts

Joined
Sun Oct 30, 2016 8:07 pm

Post by straightlight » Thu Jan 11, 2018 6:48 pm

Seem to be specifically related to languages. See by replacing your catalog/controller/common/language.php file will resolved the issue with this one: https://github.com/opencart/opencart/bl ... nguage.php as well as your catalog/view/theme/<your_theme>/common/language.twig file: https://github.com/opencart/opencart/bl ... guage.twig . Clear your OC cache.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Thu Jan 11, 2018 8:50 pm

I believe this is the fix you need. https://github.com/opencart/opencart/co ... 990171168e

The problem looks like the language was trying to read the 'language' cache, but writing the 'catalog.language' cache. Give it a try and see if it reduces the number of unlink warnings.

You will always get some unlink warnings. As you can get the problem of:
Process 1 checks if the old cache file exists. Which it does.
Process 2 checks if the old cache file exists. Which it does.
Process 1 deletes the old cache file with unlink. Which will be successful.
Process 2 deletes the old cache file with unlink. Which will fail as process 1 has already deleted it.

As this is just cache clean up, as long as the warning is not being display and only logged it won't cause any problems.

www.add-creative.co.uk


Expert Member

Posts

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

Post by straightlight » Fri Jan 12, 2018 7:14 am

Has this issue been resolved after trying the suggestion above?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by SVN » Mon Aug 06, 2018 2:44 pm

Was the last suggestion the solution ?

User avatar
SVN
Active Member

Posts

Joined
Mon Jan 03, 2011 11:59 pm

Post by straightlight » Mon Aug 06, 2018 7:40 pm

The issue is in catalog/model/localisation/language.php file. The language key needs to be changed to: catalog.language from the cache set line.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by hpwd » Sat Aug 18, 2018 8:28 am

try to hard reload with the browser or use CTRL+Shift+R

HP Web Design
OpenCart Indonesia | Toko Online OpenCart


Newbie

Posts

Joined
Sat Aug 18, 2018 7:31 am

Post by straightlight » Sat Aug 18, 2018 7:38 pm

ADD Creative has the correct answer on this topic. The issue is related with the catalog/model/localisation/language.php file gathering an undefined language cache key which I also mentioned on other topics.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by SVN » Sun Aug 19, 2018 2:21 pm

straightlight wrote:
Sat Aug 18, 2018 7:38 pm
ADD Creative has the correct answer on this topic. The issue is related with the catalog/model/localisation/language.php file gathering an undefined language cache key which I also mentioned on other topics.
For me this was indeed the solution !

User avatar
SVN
Active Member

Posts

Joined
Mon Jan 03, 2011 11:59 pm

Post by Limerick_Dude » Fri Jun 07, 2019 10:57 pm

Hi Guys,

I have tried the solution mentioned above but still get an internal server error 500 when I go to checkout.

Any ideas?

Thanks,
LD

Newbie

Posts

Joined
Thu Oct 26, 2017 6:55 pm

Post by straightlight » Mon Jun 10, 2019 3:18 am

Limerick_Dude wrote:
Fri Jun 07, 2019 10:57 pm
Any ideas?
Error logs related with error 500 unposted.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Users browsing this forum: Baidu [Spider], DigitCart and 111 guests