QuotesUK Posted November 13, 2014 Share Posted November 13, 2014 Whilst attempting to upgrade via the admin control panel I get the following error... (n.b. the space in front of .zip is as it appears) The following errors were detected: Sorry. CubeCart-5.2.14 .zip was not found. Please try again later. WARNING: Your store is not up-to-date, v5.2.14 is available, but you are running v5.2.13 Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 13, 2014 Share Posted November 13, 2014 If possible, please edit the file /admin/sources/maintenance.index.inc.php, near line 526: Was: if (($response = $request->send()) !== false) { Now: if (($response = $request->send()) !== false) { $response = trim($response); When cubecart.com went to (mostly) SSL, it seems the response comes back with a bunch of trailing whitespace. That whitespace needs to be trimmed off. Quote Link to comment Share on other sites More sharing options...
QuotesUK Posted November 17, 2014 Author Share Posted November 17, 2014 Updated the code as suggested but it still has an error "Sorry. CubeCart-5.2.14.zip was not found. Please try again later." Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 17, 2014 Share Posted November 17, 2014 Well, it's a slightly different error. This is very much probably due to cubecart.com going to SSL. You made the edit to line 526, now also make this edit in maintenance.index.inc.php:Near Line 159: Was: $contents = file_get_contents('http://www.cubecart.com/download/'.$_GET['upgrade'].'/zip'); Now: $contents = file_get_contents('https://www.cubecart.com/download/'.$_GET['upgrade'].'/zip'); Quote Link to comment Share on other sites More sharing options...
QuotesUK Posted November 17, 2014 Author Share Posted November 17, 2014 Yes, I have now made that edit too, same error. Just for information, I have a standard installation without any hacks or mods, clean install of v5 circa Feb 2013 Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 17, 2014 Share Posted November 17, 2014 That was supposed to work. Maybe something else has changed with respect to the cubecart.com website. I'll be making some tests. CC5213 was released earlier this year, not Feb 2013. Quote Link to comment Share on other sites More sharing options...
QuotesUK Posted November 17, 2014 Author Share Posted November 17, 2014 I don't know what the exact version was around Feb 2013 but that was when a clean install was carried out. I have been patching to latest versions as they come out. Just wanted to reassure you that I have a standard install. This issue now appears more complex than code typos so here is my info from server error logs (domain redacted to example.com)... mod_fcgid: stderr: PHP Warning: krsort() expects parameter 1 to be array, null given in /var/www/vhosts/example.com/httpdocs/admin/sources/maintenance.index.inc.php on line 503 mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/example.com/httpdocs/admin/sources/maintenance.index.inc.php on line 505 mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/example.com/httpdocs/admin/sources/maintenance.index.inc.php on line 498 Additional info, the code around these lines is about backups - I have already taken backups - downloaded and then deleted - so there are no online backups present. I tried creating a new database backup and upgrading but still get the same error. I also cleared caches. Quote Link to comment Share on other sites More sharing options...
stevemills Posted November 22, 2014 Share Posted November 22, 2014 I'm having the same error with my store. Please let us know when there is a definite fix for this issue. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 22, 2014 Share Posted November 22, 2014 Please check the version of PHP you have on your site. In admin, Dashboard, Store Overview tab, or PHP Info. There is a bug in PHP that is contributing to the inability to make a backup. The bug is fixed in PHP versions 5.5.17 and 5.4.33. There is a similar bug fixed in PHP 5.2.5. I do not know if the bug exists in the 5.3 series, but the last release is PHP 5.3.29 and is dated before the dates of the 5.4.33 and 5.5.17 releases. So, if the bug is in 5.3.29 or earlier, it will probably not get fixed. I do not know how far back in the PHP 5.4 and 5.5 series the bug exists, so please consult with your hosting provider to make sure your site is running these specific versions or later of these series. Quote Link to comment Share on other sites More sharing options...
QuotesUK Posted November 22, 2014 Author Share Posted November 22, 2014 My server is running php v5.3.3 I do not have a problem creating backups (even though the server log file has warnings) I am still unable to upgrade to CubeCart v5.2.14 Anyone else that is similarly affected may like to see the official bug report here... https://github.com/cubecart/CubeCart/issues/199 Quote Link to comment Share on other sites More sharing options...
eerlewein Posted November 25, 2014 Share Posted November 25, 2014 Same error here. Sorry. CubeCart-5.2.14 .zip was not found. Please try again later. Server is running php version 5.3.3. Posted lines did not fix the problem. Emanuel Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 This part of the phrase: CubeCart-5.2.14@.zip where I replaced a space with an @ character, tells me the trim() edit in post#2 is not happening. Quote Link to comment Share on other sites More sharing options...
eerlewein Posted November 25, 2014 Share Posted November 25, 2014 Is there still a way of doing the manual update? I cant find that for this 5.2.14 Update though..? Quote Link to comment Share on other sites More sharing options...
QuotesUK Posted November 25, 2014 Author Share Posted November 25, 2014 bsmither, your patch with the trim function removed the space character from my warning message I'm just wondering, do you think there is a way of just inserting a value for the download path that skips all of the (broken) routines that are supposed to assemble the path? Or is it the error routine giving us a false positive on the file not found? Seems bizarre that this should break on this upgrade when it has worked for so many upgrades before. I would assume that either CubeCart changed their download location or it's the http(s) changes as a result of Poodle SSL. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted November 25, 2014 Share Posted November 25, 2014 This has been resolved as an exception has been added to our server NOT to force SSL for access to the download files. Annoyingly DNS caches may still prevent this working for a while for some people. If anyone has any success without code modifications to your site I'd love to hear. I'm really sorry for any inconvenience caused. The demo store still doesn't work for forced upgrade. Below are the rules in place which from testing on another domain work fine. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 25, 2014 Share Posted November 25, 2014 CubeCart did not change the download location of the file except that it now requires https and the Request class can't do that yet. The second edit, making the file_get_contents() function use an https URL should work. I'm not sure why it doesn't unless the server admin has disallowed fetching files from off-site locations as a security measure. Assuming the actual problem is either any one or a combination of several factors, we can make some edits to the upgrade routine that will pre-check for the existence of the latest CubeCart package and if found, bypass trying to fetch it. in /admin/sources/maintenance.index.inc.php: Find near line 149-151: Was: if(isset($_GET['upgrade']) && !empty($_GET['upgrade'])) { $contents = false; Now: if(isset($_GET['upgrade']) && !empty($_GET['upgrade'])) { // Entering upgrade routine. $destination_path = CC_ROOT_DIR.CC_DS.'backup'.CC_DS.'CubeCart-'.trim($_GET['upgrade']).'.zip'; if(!file_exists($destination_path)) { // Don't have it - go get it. $contents = false; Near line 174: Was: $destination_path = CC_ROOT_DIR.CC_DS.'backup'.CC_DS.'CubeCart-'.$_GET['upgrade'].'.zip'; Now: // $destination_path = CC_ROOT_DIR.CC_DS.'backup'.CC_DS.'CubeCart-'.trim($_GET['upgrade']).'.zip'; Near line 177-179: Was: fclose($fp); if(file_exists($destination_path)) { Now: fclose($fp); } } if(file_exists($destination_path)) { // It's ready to process. Near line 273-277: Was: $_POST = array(); } } // end if $contents } Now: $_POST = array(); } // end if $contents } Download the latest version and then FTP that zip file to the /backup/ folder of CubeCart. Make sure the file is named CubeCart-X.Y.Z.zip where X, Y, and Z are the version numbers. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted November 25, 2014 Share Posted November 25, 2014 It can do SSL, you can use the following function in the request class; public function setSSL($verify_peer = false, $verify_host = false, $cert = null) I'm losing my mind why the basic rewrite rule on our server doesn't fix this for everyone. Quote Link to comment Share on other sites More sharing options...
eerlewein Posted November 26, 2014 Share Posted November 26, 2014 I am not sure which changes need to be performed to get this issue resolved. Is it just easier to wait out the DNS Change? Or wait till the v5.2.15 comes out? Quote Link to comment Share on other sites More sharing options...
QuotesUK Posted November 26, 2014 Author Share Posted November 26, 2014 Upgrades now working Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.