Jump to content

"MySQL server has gone away" with upgrade 1.4.9->1.5.5


Recommended Posts

I did an upgrade from PS 1.4.9 to 1.5.5 with 1-click upgrade. I ended with the message "Upgrade complete, but warnings has been found.". 

 

In the rectangle "errors" of the 1-click upgrade page I found a very long piece of text (error messages) that contained the phrase "MySQL server has gone away" some 200 times. Below you will find the first few lines.

 

The site is not usable anymore. The FO has disappeared: instead of showing the offline page it redirects to "http://index.php". The BO does not load its css and Javascript files but still somehow works on the pages that I can reach.

<div id="infoError" class="processing">
	[ERROR] PHP 1.5.0.2 /* PHP:migrate_orders(); */
	1 - 3 error(s) : <br>[insert order detail 2] - MySQL server has gone away<br>[insert order 2] - 
	MySQL server has gone away<br>unable to rename tables orders_2 and order_detail_2 to orders and order_detail<div class="clear"></div>
	[ERROR] SQL 1.5.0.2 2006 in 
	ALTER TABLE `ps_order_invoice` ADD `delivery_number` int(0) NOT NULL DEFAULT '0' AFTER `number`: 
	MySQL server has gone away<div class="clear"></div>
	[ERROR] SQL 1.5.0.2 2006 in 
	ALTER TABLE `ps_order_invoice` ADD `delivery_date` datetime AFTER `delivery_number`: 
	MySQL server has gone away<div class="clear"></div>
	[ERROR] SQL 1.5.0.2 2006 in INSERT INTO `ps_order_invoice` (`id_order`, `number`, `total_discount_tax_excl`, `total_discount_tax_incl`,
	`total_paid_tax_excl`, `total_paid_tax_incl`, `total_products`, `total_products_wt`, `total_shipping_tax_excl`, `total_shipping_tax_incl`,
	`total_wrapping_tax_excl`, `total_wrapping_tax_incl`, `note`, `date_add`) (
	SELECT `id_order`, `invoice_number`, `total_discounts_tax_excl`, `total_discounts_tax_incl`, `total_paid_tax_excl`, `total_paid_tax_incl`,
	`total_products`, `total_products_wt`, `total_shipping_tax_excl`, `total_shipping_tax_incl`, `total_wrapping_tax_excl`, 
	`total_wrapping_tax_incl`, '', `invoice_date`
	FROM `ps_orders`
	WHERE `invoice_number` != 0
): MySQL server has gone away<div class="clear"></div>[ERROR] SQL 1.5.0.2 2006 in ALTER TABLE `ps_tab` ADD `active` TINYINT(1) 
UNSIGNED NOT NULL DEFAULT '1': MySQL server has gone away<div class="clear"></div>[ERROR] SQL 1.5.0.2 2006 in UPDATE `ps_order_detail` od
SET od.`id_order_invoice` = (
	SELECT oi.`id_order_invoice`
	FROM `ps_order_invoice` oi
Edited by musicmaster (see edit history)
Link to comment
Share on other sites

Has no one else met this problem? I repeated my upgrade and I got it again!!!

 

Some further info:

>> unable to rename tables orders_2 and order_detail_2 to orders and order_detail

The system is unable to rename because the target files orders and order_detail already exist. In the end you have four files: orders, orders_2, order_detail and order_detail_2. Both orders and orders_2 have the same format (42 fields while PS 1.4.9 has 31 fields). orders_2 and order_detail_2 are empty tables without records while orders and order_detail are filled.

 

When I look at the changelog of a successful upgrade (done from a fresh 1.4.9 install) I don't see any mention of orders_2 at all.

 

>>ALTER TABLE `ps_order_invoice` ADD `delivery_number` int(0) NOT NULL DEFAULT '0' AFTER `number`:

This operation fails because 'ps_order_invoice', a table that is not present in the old version - has somehow not been created.

 

Further analysis learned that the problem was in one of the order tables. If I did the following SQL command "delete from ps_orders where id_order > '450'; delete from ps_order_detail where id_order > '450'; delete from ps_order_tax where id_order > '450'; delete from ps_order_history where id_order > '450';" the problems disappeared. I don't know whether the problem is quantity of the orders or the properties of one or more specific orders. I didn't further analyze the problem as I found the solution mentioned in the next post.

Edited by musicmaster (see edit history)
Link to comment
Share on other sites

I found the same error mentioned in the bug tracker: http://forge.prestashop.com/browse/PSCFV-10246

 

They offered here a solution that seemed to work for me: https://github.com/PrestaShop/PrestaShop/commit/7d05da1618466cca5fdfd9fc1295396d95588e62

 

For those who want to try it:

 - download the 1.5.5 zipfile from Prestashop

 - unpack this zipfile.

 - move the Prestashop directory to the "/admin/autoupgrade/latest/" directory

 - go into this Prestashop directory and go to the Install subdirectory

 - open the file "migrate_orders.php" in an editor

 - change line 78 from "$flush_limit = 1000;" to "$flush_limit = 500;"

 - download and install 1-click upgrade

 - in 1-click upgrade choose "more options"

 - choose now in the channel field "local directory" (instead of major version).

 - now you can start the upgrade

Edited by musicmaster (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi Gregory,

 

I've made about 10 attempts upgrading a shop for a customer. The shop was 1.3.6 and I upgraded to 1.4.11 manually with a few errors but nothing that seems to affect the functionallty (orders can be placed, FO and BO seem to work).

 

I have tried several things while upgrading to 1.5.5.0 with no luck. I'm using the latest 1-click upgrade module (v1.1.8-1-Click Upgrade)

 

At first, I got this error:

[Ajax / Server Error for action upgradeDb] textStatus: "error " errorThrown:"Internal Server Error " jqXHR:

 

So I made changes to the files as described here: https://github.com/PrestaShop/PrestaShop/commit/c6d2e1252e1757478339009ec7b48320b1ccd92a

 

Then the upgrade ran further and finished with pretty much the same errors as musicmaster describes. The FO of the shop is showing a white page and the BO will not open but shows errors as well.

 

I downloaded the file from your link, replaced the install folder of my downloaded PS ver. 1.5.5.0. I zipped the files and uploaded to adminXXX/autoupgrade/download and ran a 1-click update using local archive.

 

This resulted in the same error like before I changed the two files:

[Ajax / Server Error for action upgradeDb] textStatus: "error " errorThrown:"Internal Server Error " jqXHR:

 

And the upgrade does not finish.

 

I have checked that the two files are indeed updated with the corrections from the github link. So now I'm back to square one and still no success in upgrading.

 

Btw I tried a manual upgrade to 1.5.5.0 prior to all this, but the update script would not run as it said I am already using the latest version although the settings.inc.php was correctly copied and said version 1.4.11.

 

Any help is appreciated.

Edited by Prestafan1234 (see edit history)
Link to comment
Share on other sites

Hi,

 

Open a ticket on forge.prestashop.com, send to me the number so that I affect it to me. I am sure this can be settled very quicly, very few updates encounter SQL issues now. Did you simply consult the myslq logs and Apache logs after the failure ?

 

Having a blank page in front office after an upgrade from 1.4 can be totally normal and this can come from many things. Enabling mod_dev in defines.inc.php most of the time can help you settling out the issue, and most of the time a third party module is in cause. There is always work after an upgrade from 1.4 to 1.5. But not being able to log in back office is very strange and uncommun, I can help you with that.

 

Please do not try manual upgrades in you are not familiar with it.

 

Best regards

Link to comment
Share on other sites

UPDATE: After setting up a WAMP server and making the upgrade there, it goes through without any errors :)

 

(still with the use of the upgraded files from post #4) So all my errors must have been due to timeout issues on the server. Will make all upgrades locally from now on.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...