sting5 Posted May 8, 2016 Share Posted May 8, 2016 Had strange error after updating my Prestashop to newest version today. Just to make sure I'm on a safe side, shop was copied to WAMP server on HDD, linked the DB and everything worked fine prior the update. 1. Downloaded newest 1 click upgrade module version; 2. Initiated the update process; 3. Everything went fine, some errors were shown after it finished, I did not save them though, because shop worked fine; 4. current theme looked horrible so I've decided default-bootstrap as my shop's theme; 5. I was offered some modules to install, some to disable for theme to work properly; 6. Clicked "SAVE"; 7. The localhost page isn’t workinglocalhost is currently unable to handle this request. 500 Dev mode showed this error: 112. /* Initialize the current Shop */113. try {114. $context->shop = Shop::initialize();115. $context->theme = new Theme((int)$context->shop->id_theme);116. if ((Tools::isEmpty($theme_name = $context->shop->getTheme()) || !Validate::isLoadedObject($context->theme)) && !defined('_PS_ADMIN_DIR_')) {117. throw new PrestaShopException(Tools::displayError('Current theme unselected. Please check your theme configuration.'));118. }119. } catch (PrestaShopException $e) {120. $e->displayMessage();121. }122. define('_THEME_NAME_', $theme_name); I suppose that the problem might be caused by some sort of glitch, decided to check in back office. This beauty shows up: Unknown column 'last_connection_date' in 'where clause' UPDATE `ps_employee` SET `last_connection_date` = CURRENT_DATE() WHERE `id_employee` = 1 AND `last_connection_date`< CURRENT_DATE() at line 791 in file classes/db/Db.php 786. if ($webservice_call && $errno) {787. $dbg = debug_backtrace();788. WebserviceRequest::getInstance()->setError(500, ' '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {790. if ($sql) {791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');792. }793.794. throw new PrestaShopDatabaseException($this->getMsgError());795. }796. } DbCore->displayError - [line 425 - classes/db/Db.php] - [1 Arguments] DbCore->query - [line 601 - classes/db/Db.php] - [1 Arguments] DbCore->execute - [line 494 - classes/Employee.php] - [1 Arguments] EmployeeCore::setLastConnectionDate - [line 2742 - classes/controller/AdminController.php] - [1 Arguments] AdminControllerCore->init - [line 170 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 58 - tvarkytuvas/index.php] So I'm just wondering, if it's worth it to update the Prestashop or just make fresh install, copy the database onto fresh install? Thanks for any help! Link to comment Share on other sites More sharing options...
Prestachamps Posted May 8, 2016 Share Posted May 8, 2016 Hi, You will have to add a new database column last_connection_date in table ps_employee (from phpmyadmin). It seems your upgrade didn't finished 100 percent, and some database tables structure were not upgraded. If you will have similar database missing column errors after this fix, you should reupgrade from the beginning(old 1.4 version),but now writing down the errors. Redards, Leo Link to comment Share on other sites More sharing options...
sting5 Posted May 9, 2016 Author Share Posted May 9, 2016 (edited) Hi Leo, thanks for Your ideas - I've decided to repeat the updating process, here is the error message, given by the upgrade module: SQL 1.5.0.1 1067 in ALTER TABLE `ps_order_detail` ADD `id_order_invoice` int(11) NOT NULL DEFAULT 0 AFTER `id_order`: Invalid default value for 'download_deadline' SQL 1.5.0.2 1067 in ALTER TABLE `ps_order_detail` ADD `reduction_amount_tax_incl` DECIMAL( 20, 6 ) NOT NULL AFTER `reduction_amount` , ADD `reduction_amount_tax_excl` DECIMAL( 20, 6 ) NOT NULL AFTER `reduction_amount_tax_incl`, ADD `total_price_tax_incl` DECIMAL(20, 6) NOT NULL AFTER `download_deadline`, ADD `total_price_tax_excl` DECIMAL(20, 6) NOT NULL AFTER `total_price_tax_incl`, ADD `unit_price_tax_incl` DECIMAL(20, 6) NOT NULL AFTER `total_price_tax_excl`, ADD `unit_price_tax_excl` DECIMAL(20, 6) NOT NULL AFTER `unit_price_tax_incl`, ADD `total_shipping_price_tax_incl` DECIMAL(20, 6) NOT NULL AFTER `unit_price_tax_excl`, ADD `total_shipping_price_tax_excl` DECIMAL(20, 6) NOT NULL AFTER `total_shipping_price_tax_incl`, ADD `purchase_supplier_price` DECIMAL(20, 6) NOT NULL AFTER `total_shipping_price_tax_excl`, ADD `original_product_price` DECIMAL(20, 6) NOT NULL AFTER `purchase_supplier_price`: Invalid default value for 'download_deadline' SQL 1.5.0.2 1067 in ALTER TABLE `ps_order_detail` ADD `tax_computation_method` tinyint(1) unsigned NOT NULL default '0' AFTER `product_weight`: Invalid default value for 'download_deadline' [ERROR] PHP 1.5.0.2 /* PHP:migrate_orders(); */ 1 - 48 error(s) : unable to duplicate tables orders and order_detail[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 1[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 4[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 10[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 5[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 7[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 9[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'delivery_date' at row 10[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 3[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 28[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 7[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 5[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 14[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 2[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 70[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 9[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 22[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 18[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 1[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 11[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 67[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 2[insert order detail 1] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 2] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 23[insert order detail 3] - Table 'nanotekas.ps_order_detail_2' doesn't exist[insert order 4] - Incorrect datetime value: '0000-00-00 00:00:00' for column 'invoice_date' at row 1unable to rename tables orders_2 and order_detail_2 to orders and order_detail SQL 1.5.0.2 1146 in UPDATE `ps_order_detail` od SET od.`id_order_invoice` = IFNULL(( SELECT oi.`id_order_invoice` FROM `ps_order_invoice` oi WHERE oi.`id_order` = od.`id_order` LIMIT 1 ), 0): Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.5.0.2 1146 in INSERT INTO `ps_order_carrier` (`id_order`, `id_carrier`, `id_order_invoice`, `weight`, `shipping_cost_tax_excl`, `shipping_cost_tax_incl`, `tracking_number`, `date_add`) ( SELECT `id_order`, `id_carrier`, ( SELECT oi.`id_order_invoice` FROM `ps_order_invoice` oi WHERE oi.`id_order` = o.`id_order` LIMIT 1 ), ( SELECT SUM(`product_weight`) FROM `ps_order_detail` od WHERE od.`id_order` = o.`id_order` LIMIT 1 ), `total_shipping_tax_excl`, `total_shipping_tax_incl`, `shipping_number`, `date_add` FROM `ps_orders` o ): Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.5.0.5 1292 in REPLACE INTO `ps_configuration`(`id_group_shop`, `id_shop`, `name`, `value`, `date_add`, `date_upd`) VALUES((SELECT IFNULL(@id_configuration, NULL)), NULL, 'PS_LOGO', 'logo.jpg', '0000-00-00 00:00:00', '0000-00-00 00:00:00'): Incorrect datetime value: '0000-00-00 00:00:00' for column 'date_add' at row 1 SQL 1.5.0.8 1067 in CREATE TABLE IF NOT EXISTS `ps_accounting_export` ( `id_accounting_export` int(11) NOT NULL AUTO_INCREMENT, `begin_to` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `end_to` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `type` int(11) NOT NULL, `file` varchar(256) NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id_accounting_export`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8: Invalid default value for 'begin_to' SQL 1.5.0.10 1292 in INSERT INTO `ps_product_shop_TMP` (`id_product`, `id_shop`, `id_category_default`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `active`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `id_tax_rules_group`) (SELECT a.`id_product`, a.`id_shop`, b.`id_category_default`, b.`on_sale`, b.`online_only`, b.`ecotax`, b.`minimal_quantity`, b.`price`, b.`wholesale_price`, b.`unity`, b.`unit_price_ratio`, b.`additional_shipping_cost`, b.`customizable`, b.`text_fields`, b.`active`, b.`available_for_order`, b.`available_date`, b.`condition`, b.`show_price`, b.`indexed`, b.`visibility`, b.`cache_default_attribute`, b.`advanced_stock_management`, b.`date_add`, b.`date_upd`, c.`id_tax_rules_group` FROM `ps_product_shop` a INNER JOIN `ps_product` b ON a.id_product = b.id_product LEFT JOIN `ps_product_tax_rules_group_shop` c ON b.id_product = c.id_product AND a.id_shop = c.id_shop): Incorrect date value: '0000-00-00' for column 'available_date' at row 1 SQL 1.5.0.10 1292 in INSERT INTO `ps_product_attribute_shop` (`id_product_attribute`, `id_shop`, `wholesale_price`, `price`, `ecotax`, `weight`, `unit_price_impact`, `default_on`, `minimal_quantity`, `available_date`) (SELECT `id_product_attribute`, (SELECT `value` FROM `ps_configuration` WHERE `name` = 'PS_SHOP_DEFAULT'), `wholesale_price`, `price`, `ecotax`, `weight`, `unit_price_impact`, `default_on`, `minimal_quantity`, `available_date` FROM `ps_product_attribute`): Incorrect date value: '0000-00-00' for column 'available_date' at row 2 SQL 1.5.0.12 1051 in DROP TABLE `ps_accounting_export`: Unknown table 'nanotekas.ps_accounting_export' SQL 1.5.0.12 1146 in UPDATE ps_order_detail_tax odt LEFT JOIN ps_tax t ON (t.id_tax = odt.id_tax) SET unit_amount = IFNULL(ROUND((t.rate / 100) * ( SELECT od.unit_price_tax_excl - ( o.total_discounts_tax_excl * ( od.unit_price_tax_excl / o.total_products )) FROM ps_order_detail od LEFT JOIN ps_orders o ON ( o.id_order = od.id_order) WHERE odt.id_order_detail = od.id_order_detail ), 2), 0): Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.5.0.12 1146 in UPDATE ps_order_detail_tax odt LEFT JOIN ps_order_detail od ON (od.id_order_detail = odt.id_order_detail) SET total_amount = IFNULL(odt.unit_amount * od.product_quantity, 0): Table 'nanotekas.ps_order_detail' doesn't exist [ERROR] PHP 1.5.0.12 /* PHP:p15012_add_missing_columns(); */ 1 - ALTER TABLE `ps_cart_product` CHANGE `id_product_attribute` `id_product_attribute` int(10) unsigned DEFAULT NULL AFTER `id_shop`All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead SQL 1.5.0.16 1146 in ALTER TABLE `ps_order_detail` ADD `id_shop` INT(11) UNSIGNED NOT NULL AFTER `id_warehouse`, ADD INDEX (`id_shop`): Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.5.0.16 1146 in UPDATE `ps_order_detail` od SET `id_shop`=(SELECT `id_shop` FROM `ps_orders` WHERE `id_order`=od.`id_order`): Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.5.1.0 1292 in ALTER TABLE `ps_product` CHANGE `width` `width` DECIMAL(20, 6) NOT NULL DEFAULT '0', CHANGE `height` `height` DECIMAL(20, 6) NOT NULL DEFAULT '0', CHANGE `depth` `depth` DECIMAL(20, 6) NOT NULL DEFAULT '0', CHANGE `weight` `weight` DECIMAL(20, 6) NOT NULL DEFAULT '0': Incorrect date value: '0000-00-00' for column 'available_date' at row 1 SQL 1.5.1.0 1292 in ALTER TABLE `ps_product_attribute` CHANGE `weight` `weight` DECIMAL(20, 6) NOT NULL DEFAULT '0': Incorrect date value: '0000-00-00' for column 'available_date' at row 1 SQL 1.5.1.0 1064 in ALTER IGNORE TABLE `ps_order_carrier` CHANGE `weight` `weight` DECIMAL(20, 6) NOT NULL DEFAULT '0': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_order_carrier` CHANGE `weight` `weight` DECIMAL(20, 6) NOT NULL' at line 1 SQL 1.5.1.0 1146 in ALTER TABLE `ps_order_detail` CHANGE `product_weight` `product_weight` DECIMAL(20, 6) NOT NULL DEFAULT '0': Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.5.3.0 1064 in ALTER IGNORE TABLE `ps_cart` CHANGE `delivery_option` `delivery_option` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_cart` CHANGE `delivery_option` `delivery_option` TEXT CHARACTER' at line 1 SQL 1.5.3.1 1064 in ALTER IGNORE TABLE `ps_cart` CHANGE `delivery_option` `delivery_option` TEXT NOT NULL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_cart` CHANGE `delivery_option` `delivery_option` TEXT NOT NULL' at line 1 SQL 1.6.0.4 1064 in ALTER IGNORE TABLE `ps_meta` ADD UNIQUE (`page`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_meta` ADD UNIQUE (`page`)' at line 1 SQL 1.6.0.10 1146 in ALTER TABLE `ps_order_detail` ADD `id_tax_rules_group` INT(11) UNSIGNED DEFAULT '0' AFTER `product_weight`, ADD INDEX `id_tax_rules_group` (`id_tax_rules_group`): Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.6.0.10 1067 in ALTER TABLE `ps_employee` ADD `last_connection_date` date NOT NULL DEFAULT '0000-00-00': Invalid default value for 'last_connection_date' SQL 1.6.0.11 1292 in ALTER TABLE `ps_product_attribute` MODIFY `unit_price_impact` DECIMAL(20,6): Incorrect date value: '0000-00-00' for column 'available_date' at row 1 SQL 1.6.0.11 1064 in ALTER IGNORE TABLE `ps_product` CHANGE `ean13` `ean13` BIGINT( 15 ) NULL DEFAULT NULL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_product` CHANGE `ean13` `ean13` BIGINT( 15 ) NULL DEFAULT NULL' at line 1 SQL 1.6.0.11 1064 in ALTER IGNORE TABLE `ps_product_attribute` CHANGE `ean13` `ean13` BIGINT( 15 ) NULL DEFAULT NULL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_product_attribute` CHANGE `ean13` `ean13` BIGINT( 15 ) NULL DEF' at line 1 SQL 1.6.0.12 1067 in ALTER TABLE `ps_product` CHANGE `available_date` `available_date` DATE NOT NULL DEFAULT '0000-00-00': Invalid default value for 'available_date' SQL 1.6.0.12 1067 in ALTER TABLE `ps_product_shop` CHANGE `available_date` `available_date` DATE NOT NULL DEFAULT '0000-00-00': Invalid default value for 'available_date' SQL 1.6.0.12 1067 in ALTER TABLE `ps_product_attribute` CHANGE `available_date` `available_date` DATE NOT NULL DEFAULT '0000-00-00': Invalid default value for 'available_date' SQL 1.6.0.12 1067 in ALTER TABLE `ps_product_attribute_shop` CHANGE `available_date` `available_date` DATE NOT NULL DEFAULT '0000-00-00': Invalid default value for 'available_date' SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_cart_product` ADD PRIMARY KEY (`id_cart`,`id_product`,`id_product_attribute`,`id_address_delivery`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_cart_product` ADD PRIMARY KEY (`id_cart`,`id_product`,`id_produ' at line 1 SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_customization` ADD KEY `id_cart_product` (`id_cart`, `id_product`, `id_product_attribute`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_customization` ADD KEY `id_cart_product` (`id_cart`, `id_produc' at line 1 SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_image_shop` DROP KEY `id_image`, ADD PRIMARY KEY (`id_image`, `id_shop`, `cover`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_image_shop` DROP KEY `id_image`, ADD PRIMARY KEY (`id_image`, `' at line 1 SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_image_shop` DROP PRIMARY KEY, ADD PRIMARY KEY (`id_image`, `id_shop`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_image_shop` DROP PRIMARY KEY, ADD PRIMARY KEY (`id_image`, `id_' at line 1 SQL 1.6.1.0 1067 in CREATE TABLE `ps_smarty_lazy_cache` ( `template_hash` varchar(32) NOT NULL DEFAULT '', `cache_id` varchar(255) NOT NULL DEFAULT '', `compile_id` varchar(32) NOT NULL DEFAULT '', `filepath` varchar(255) NOT NULL DEFAULT '', `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8: Invalid default value for 'last_update' SQL 1.6.1.0 1067 in CREATE TABLE `ps_smarty_last_flush` ( `type` ENUM('compile', 'template'), `last_flush` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8: Invalid default value for 'last_flush' SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_image` ADD UNIQUE KEY `id_product_cover` (`id_product`,`cover`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_image` ADD UNIQUE KEY `id_product_cover` (`id_product`,`cover`)' at line 1 SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_image_shop` ADD UNIQUE KEY `id_product` (`id_product`, `id_shop`, `cover`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_image_shop` ADD UNIQUE KEY `id_product` (`id_product`, `id_shop' at line 1 SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_product_attribute` ADD UNIQUE KEY `product_default` (`id_product`,`default_on`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_product_attribute` ADD UNIQUE KEY `product_default` (`id_produc' at line 1 SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_product_attribute_shop` ADD UNIQUE KEY `id_product` (`id_product`, `id_shop`, `default_on`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_product_attribute_shop` ADD UNIQUE KEY `id_product` (`id_produc' at line 1 SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_product_download` ADD UNIQUE KEY `id_product` (`id_product`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_product_download` ADD UNIQUE KEY `id_product` (`id_product`)' at line 1 SQL 1.6.1.0 1292 in UPDATE `ps_product_shop` SET `date_add` = NOW() WHERE `date_add` = "0000-00-00 00:00:00": Incorrect datetime value: '0000-00-00 00:00:00' for column 'date_add' at row 1 SQL 1.6.1.0 1146 in ALTER TABLE `ps_smarty_lazy_cache` CHANGE `cache_id` `cache_id` varchar(255) NOT NULL DEFAULT '': Table 'nanotekas.ps_smarty_lazy_cache' doesn't exist SQL 1.6.1.0 1146 in TRUNCATE TABLE `ps_smarty_lazy_cache`: Table 'nanotekas.ps_smarty_lazy_cache' doesn't exist SQL 1.6.1.0 1064 in ALTER IGNORE TABLE `ps_specific_price` ADD UNIQUE KEY `id_product_2` (`id_cart`, `id_product`,`id_shop`,`id_shop_group`,`id_currency`,`id_country`,`id_group`,`id_customer`,`id_product_attribute`,`from_quantity`,`id_specific_price_rule`,`from`,`to`): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `ps_specific_price` ADD UNIQUE KEY `id_product_2` (`id_cart`, `id_p' at line 1 SQL 1.6.1.1 1292 in ALTER TABLE `ps_customer_message` CHANGE `message` `message` MEDIUMTEXT NOT NULL: Incorrect datetime value: '0000-00-00 00:00:00' for column 'date_upd' at row 1 SQL 1.6.1.1 1292 in UPDATE `ps_tax_rules_group` SET `date_add` = NOW(), `date_upd` = NOW() WHERE `date_add` = '0000-00-00 00:00:00': Incorrect datetime value: '0000-00-00 00:00:00' for column 'date_add' at row 1 SQL 1.6.1.1 1146 in ALTER TABLE `ps_order_detail` ADD `original_wholesale_price` DECIMAL( 20, 6 ) NOT NULL DEFAULT '0.000000': Table 'nanotekas.ps_order_detail' doesn't exist SQL 1.6.1.2 1146 in TRUNCATE TABLE `ps_smarty_last_flush`: Table 'nanotekas.ps_smarty_last_flush' doesn't exist Warning detected during upgrade. I'm not strong with MySQL, but this seems it is just like You've said, some sort of writing error in the database because of specific tables missing. I've installed clean 1.6 into localhost via WAMP and truly, newly created 1.6 database has a different structure compared to 1.4. Now my idea is, that the 1.4.8.2 version of Prestashop did not have correct setup of tables due to rather significant gap between 1.4 and 1.6 version, thus the installation failed? Or is this just the permissions thing in WAMP's PhpMyAdmin? What would be the best solution - adding those tables and columns prior the update into the 1.4 database structure? Thanks for any advice! P. S. Just to compare the number of tables: my current 1.4.8.2 holds 180 tables; fresh 1.6.1 install holds 250 tables; the upgraded version consisted of 250 tables; Edited May 9, 2016 by sting5 (see edit history) Link to comment Share on other sites More sharing options...
Prestachamps Posted May 9, 2016 Share Posted May 9, 2016 Hi, your error could be caused by the fact that in the mysql server's configuration MySQL strict mode is enabled. Ask your hosting to disable the MySQL strict mode , and retry the upgrade. This could solve your issue. Regards, Leo Link to comment Share on other sites More sharing options...
sting5 Posted May 9, 2016 Author Share Posted May 9, 2016 (edited) Hi, your error could be caused by the fact that in the mysql server's configuration MySQL strict mode is enabled. Ask your hosting to disable the MySQL strict mode , and retry the upgrade. This could solve your issue. Regards, Leo Hi Leo, thanks again for Your advice... But the server I'm running is localhost - it's on WAMP, permissions should be fine. But I will check and tell how it went, thanks! [EDITED 2016-05-09 18:16 GMT+2]: Yes, You were right Leo! The MySQL was set to a strict mode! I've removed it, will try to install again. Thanks for all the help so far, You're hitting nails here! Edited May 9, 2016 by sting5 (see edit history) Link to comment Share on other sites More sharing options...
sting5 Posted May 9, 2016 Author Share Posted May 9, 2016 (edited) Ok so turning off the strict mode did not help. The error log came back identical to the ones before. I've noticed one interesting thing - module shows that all parameters meet the requirements: Before starting the upgrade process, please make sure this checklist is all green. The 1-click upgrade module is up-to-date (your current version is v1.6.7) Your store's root directory is writable (with appropriate CHMOD permissions) PHP's "Safe mode" option is turned off PHP's "allow_url_fopen" option is turned on, or cURL is installed Your store is in maintenance mode PrestaShop's caching features are disabled The mobile theme is disabled PHP's max_execution_time setting has a high value or is disabled entirely (current value: unlimited) But the shop is not in maintenance mode (that I know for sure), though it shows green light. I'm not even sure about other prerequisites. Might it be that there's something wrong with prestashop copy in general...? [EDITED 2016-05-09 21:06 GMT+2]: Ok so all the requirements meet the demand. I have even switched back to default 1.4 theme prior upgrading. Did not help, all the errors stay the same. I will try to check how upgrading to 1.5.x and only then yo 1.6.1 works. Maybe that is the case... Edited May 9, 2016 by sting5 (see edit history) Link to comment Share on other sites More sharing options...
sting5 Posted May 9, 2016 Author Share Posted May 9, 2016 (edited) Updating from 1.4 to 1.5 manually gave no luck either - many similar errors. Must be something wrong with the server configuration, can't find out what exactly... [EDITED 2016-05-09 22:39 GMT+2]: Ok after trying to manually update 1.4.8.2 to 1.6.1.5 (launching /upgrade/upgrade.php script) I've received this error message (with similar errors): <action result="fail" error="34">........ After checking the prestashop manual upgrade guide, this is what I find: 34 Internal SQL error. The SQL update files might be corrupted. Download the new version's archive again, and use its files from the /install/upgrade/sql. Should I upgrade the SQL..?? Edited May 9, 2016 by sting5 (see edit history) Link to comment Share on other sites More sharing options...
Prestachamps Posted May 10, 2016 Share Posted May 10, 2016 HI, verify if this file is really corrupt as it is stated in the error (open it and see if the file is ok) : /install/upgrade/sql. You could try to upgrade in steps: first to the latest 1.4 version ( v1.4.11.1 stable ) , and then to 1.5 latest , then to 1.6 latest. Regards, Leo Link to comment Share on other sites More sharing options...
sting5 Posted May 10, 2016 Author Share Posted May 10, 2016 (edited) Ok Leo, thanks, installing 1.4.8.2 --> 1.4.11.1 --> 1.5.x --> 1.6.1.5 might do the trick, I will try that. What is funny is that WAMP is just half of the job done, if it work on local server, that does not necessarily mean same trick will help on live server. Just so to grasp what's going on, I've tried TEST-installing fresh 1.5.20 version to check how MySQL acts in localhost - I've received an error on install step 3: Engine innoDB is not supported by your MySQL server, please use MyISAM (DbPDO) But when I've tried to install 1.6.1, everything was fine with innoDB. My MySQL is version 5.7.9, might this be incompatible..? Just saying... Edited May 10, 2016 by sting5 (see edit history) Link to comment Share on other sites More sharing options...
sting5 Posted May 10, 2016 Author Share Posted May 10, 2016 verify if this file is really corrupt as it is stated in the error (open it and see if the file is ok) : /install/upgrade/sql. The install was freshly copied straight from the zip I've downloaded... what inconsistencies should I be looking for Leo? Link to comment Share on other sites More sharing options...
Prestachamps Posted May 11, 2016 Share Posted May 11, 2016 Hi, For inconsistency I mean if the sql file contains any reference for innodb or the sql file has any strange characters when opened in a text editor.(but if the files were copied from the zip there should not be this the issue). You could check the error logs for msql in wamp or the apache error logs in wamp folders. Regarding wamp, if you suppose it is not good for testing, you can stop wamp and install Xampp, try uppgrading in the xampp your shop. https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/ Regards, Leo Link to comment Share on other sites More sharing options...
sting5 Posted May 11, 2016 Author Share Posted May 11, 2016 Thanks Leo, I really appreciate Your input in this (the ideas is what matters in this field of work) As for the 1.4.8.2 --> 1.4.11.1 install procedure, I've made it through newest version of 1-click upgrade module, still received the error code (much, much shorter one though): SQL 1.4.10.0 1048 in INSERT INTO `ps_hook_module` (`id_module`, `id_hook` , `position`) (SELECT id_module, 50, (SELECT max_position from (SELECT MAX(position)+1 as max_position FROM `ps_hook_module` WHERE `id_hook` = 50) tmp) FROM `ps_module` WHERE `name` = 'backwardcompatibility'): Column 'position' cannot be null SQL 1.4.10.0 1048 in INSERT INTO `ps_hook_module` (`id_module`, `id_hook` , `position`) (SELECT id_module, 54, (SELECT max_position from (SELECT MAX(position)+1 as max_position FROM `ps_hook_module` WHERE `id_hook` = 54) tmp) FROM `ps_module` WHERE `name` = 'backwardcompatibility'): Column 'position' cannot be null Warning detected during upgrade. Seems that SQL is ok, but there's some mismatch with the module hook... Should I worry about it or just continue the update and see how it goes? Thanks again..! Link to comment Share on other sites More sharing options...
sting5 Posted May 15, 2016 Author Share Posted May 15, 2016 Ok so after few days of tinkering and trying to understand what is happening here, I've only managed to raise the version from 1.4.8.2 to 1.4.11.1 without crashing the shop. When upgrading from 1.4.11.1 to 1.5.2.0, module gave a bunch of errors again and the shop crashed - Backoffice is working though. Checked the error logs for Apache, MySQL and PHP, only PHP contained some errors (attaching as file). My PHP version is 5.6.16 by the way. After different approaches to update process, trying various methods and ideas, checking server settings and so on... I think it's safe to say that all the problems come from PHP code in the updating module, nowhere else. The code is either outdated or not compatible with current PHP versions anymore. So if anyone would be asking me if it's worth upgrading from 1.4.x to 1.6.x I would probably say plainly "No." It would be for the best to export products, clients and their data and import them onto fresh new version of Prestahop and get done with it much faster and easier. Thanks again Leo for all the help provided. I can only hope that my export procedure will be more successful... php_error.txt Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now