Jump to content

Front Office (website) - PrestaShopDatabaseException - Prestashop v1.6.1.17


V-5

Recommended Posts

I upgraded from Prestashop version 1.5 to 1.6.1.17. Everything went well using the 1-Click upgrade option without any errors.

 

After the upgrade the Prestashop back office also logged in well without any issues.

 

However, after the upgrade when I enabled the website (turned off Maintenance), I started getting the "PrestaShopDatabaseException".

 

As of now I have put the site back to "Maintenance" but I need help to resolve this issue.

 

I am not a developer but have read and followed instructions and managed to setup the site and had been running it since more than a year now without issues. Please help and provide detailed steps as what I need to do to resolve this issue.

 

I also tried to restore the old database (I had taken backup before upgrade) but even after restoring old DB I get issues.

 

The complete error is given below:

 

[PrestaShopDatabaseException]

Table 'xyzab.ps_feature' doesn't exist
 

        SELECT id_product, name, value, pf.id_feature
        FROM ps_feature_product pf
        LEFT JOIN ps_feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 1)
        LEFT JOIN ps_feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 1)
        LEFT JOIN ps_feature f ON (f.id_feature = pf.id_feature)
         INNER JOIN ps_feature_shop feature_shop
        ON (feature_shop.id_feature = f.id_feature AND feature_shop.id_shop = 1)
        WHERE `id_product` IN (74)
        ORDER BY f.position ASC

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]
    Argument [0]

            SELECT id_product, name, value, pf.id_feature
            FROM ps_feature_product pf
            LEFT JOIN ps_feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 1)
            LEFT JOIN ps_feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 1)
            LEFT JOIN ps_feature f ON (f.id_feature = pf.id_feature)
             INNER JOIN ps_feature_shop feature_shop
            ON (feature_shop.id_feature = f.id_feature AND feature_shop.id_shop = 1)
            WHERE `id_product` IN (74)
            ORDER BY f.position ASC
  • DbCore->query - [line 643 - classes/db/Db.php] - [1 Arguments]
    Argument [0]

            SELECT id_product, name, value, pf.id_feature
            FROM ps_feature_product pf
            LEFT JOIN ps_feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 1)
            LEFT JOIN ps_feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 1)
            LEFT JOIN ps_feature f ON (f.id_feature = pf.id_feature)
             INNER JOIN ps_feature_shop feature_shop
            ON (feature_shop.id_feature = f.id_feature AND feature_shop.id_shop = 1)
            WHERE `id_product` IN (74)
            ORDER BY f.position ASC
  • DbCore->executeS - [line 3740 - classes/Product.php] - [1 Arguments]
    Argument [0]

            SELECT id_product, name, value, pf.id_feature
            FROM ps_feature_product pf
            LEFT JOIN ps_feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 1)
            LEFT JOIN ps_feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 1)
            LEFT JOIN ps_feature f ON (f.id_feature = pf.id_feature)
             INNER JOIN ps_feature_shop feature_shop
            ON (feature_shop.id_feature = f.id_feature AND feature_shop.id_shop = 1)
            WHERE `id_product` IN (74)
            ORDER BY f.position ASC
  • ProductCore::cacheFrontFeatures - [line 2358 - classes/Product.php] - [2 Arguments]
    2353. $products_ids = array();
    2354. foreach ($result as $row) {
    2355. $products_ids[] = $row['id_product'];
    2356. }
    2357. // Thus you can avoid one query per product, because there will be only one query for all the products of the cart
    2358. Product::cacheFrontFeatures($products_ids, $id_lang);
    2359. return Product::getProductsProperties((int)$id_lang, $result);
    2360. }
    2361.
    2362. protected static function _getProductIdByDate($beginning, $ending, Context $context = null, $with_combination = false)
    2363. {
  • ProductCore::getNewProducts - [line 305 - modules/leotempcp/classes/widget/carousel.php] - [6 Arguments]
    300. $interval = (isset($setting['interval'])) ? (int)($setting['interval']) : 8000;
    301. switch ($setting['source']) {
    302. case 'ptype':
    303. switch ($setting['ptype']) {
    304. case 'newest':
    305. $products = Product::getNewProducts($this->langID, 0, $nb, false, $orderby, $orderway);
    306. break;
    307. case 'featured':
    308. $category = new Category(Context::getContext()->shop->getCategory(), $this->langID);
    309. $products = $category->getProducts((int)$this->langID, 1, $nb, $orderby, $orderway);
    310. break;
  • LeoWidgetCarousel->renderContent - [line 236 - modules/leotempcp/classes/widget.php] - [2 Arguments]
    231. $data['widget_heading'] = isset($data['widget_title_'.$this->langID]) ? Tools::stripslashes($data['widget_title_'.$this->langID]) : '';
    232.
    233. //echo $method;
    234. if (isset($this->engines[$type])) {
    235. $args = array();
    236. return $this->engines[$type]->renderContent($args, $data);
    237. }
    238. return false;
    239. }
    240.
    241. /**
  • LeoTempcpWidget->getWidgetContent - [line 249 - modules/leotempcp/classes/widget.php] - [2 Arguments]
    244. public function renderContent($id)
    245. {
    246. $output = array('id' => $id, 'type' => '', 'data' => '');
    247. if (isset($this->widgets[$id])) {
    248. # validate module
    249. $output = $this->getWidgetContent($this->widgets[$id]['type'], $this->widgets[$id]['params']);
    250. }
    251.
    252. return $output;
    253. }
    254.
  • LeoTempcpWidget->renderContent - [line 1148 - modules/leomanagewidgets/leomanagewidgets.php] - [1 Arguments]
    1143. if (isset($column['rows'])) {
    1144. foreach ($column['rows'] as &$row) {
    1145.
    1146. if ($row['type'] == '0') {
    1147.                                 # LOAD WIDGET
    1148. $content = $this->_widgets->renderContent($row['key_widget']);
    1149. $content['type'] = LeomanagewidgetsHelper::processWidgetType($hook_name, $row['key_widget'], $content['type'], $content['data']);
    1150. //if ($this->_load_owl_carousel_lib == false)
    1151. //    $this->_load_owl_carousel_lib = LeomanagewidgetsHelper::enableLoadOwlCarouselLib($content['data']);
    1152. $row['content'] = $this->getWidgetContent($hook_name, $row['key_widget'], $content['type'], $content['data']);
    1153. } else {
  • LeoManagewidgets->_setGroupData - [line 1242 - modules/leomanagewidgets/leomanagewidgets.php] - [2 Arguments]
    1237. //return if don't exist
    1238. if (!isset($this->_groupList[$hook_name])) {
    1239. return false;
    1240. }
    1241. $groups = array();
    1242. $groups = $this->_setGroupData($this->_groupList[$hook_name], $hook_name);
    1243.
    1244. $this->smarty->assign('leoGroup', $groups);
    1245.
    1246. if ($this->_has_bg_style) {
    1247. $this->smarty->assign('LEO_BG_STYLE_DATA', $this->_bg_style_config_data);
  • LeoManagewidgets->_processHook - [line 1545 - modules/leomanagewidgets/leomanagewidgets.php] - [1 Arguments]
    1540. return $this->_processHook('displayLeftColumn');
    1541. }
    1542.
    1543. public function hookDisplayHome()
    1544. {
    1545. return $this->_processHook('displayHome');
    1546. }
    1547.
    1548. public function hookDisplayFooter()
    1549. {
    1550. return $this->_processHook('displayFooter').$this->header_content;
  • LeoManagewidgets->hookDisplayHome - [line 591 - classes/Hook.php] - [1 Arguments]
    Argument [0]
     
  • HookCore::coreCallHook - [line 546 - classes/Hook.php] - [3 Arguments]
    Argument [0]
Edited by V-5 (see edit history)
Link to comment
Share on other sites

You make it such a complex story that I don't get what really happened.

 

ps_feature is one of the key tables of Prestashop. So when you end up missing it something is seriously wrong. But it is not clear to me when you got that error: after the update or after the implementation of the backup. Also it is not clear how you made a backup and how you restored it. Please note that the backup of the update module is notoriously unreliable. You should never never never depend on that. Instead you should make your own backup: copying all the files and making a database dump with Phpmyadmin.

 

One of the most likely explanations is that your Leotheme version (or some other module) does not support Prestashop 1.6.1. Only you can check that.

Link to comment
Share on other sites

You make it such a complex story that I don't get what really happened.

 

ps_feature is one of the key tables of Prestashop. So when you end up missing it something is seriously wrong. But it is not clear to me when you got that error: after the update or after the implementation of the backup. Also it is not clear how you made a backup and how you restored it. Please note that the backup of the update module is notoriously unreliable. You should never never never depend on that. Instead you should make your own backup: copying all the files and making a database dump with Phpmyadmin.

 

One of the most likely explanations is that your Leotheme version (or some other module) does not support Prestashop 1.6.1. Only you can check that.

Thanks for the reply and sorry for all the confusion. Like I said, I am not a developer but try to do as much as possible.

 

Anyways, to answer your questions:

 

1) I started getting this error immediately after I upgraded the version from 1.5 to 1.6.1.17 using the 1-click upgrade

2) I made the backup using the 'DB Backup' option available under "Advanced Parameters" in Prestashop back office

3) I restored the old DB using 'Import' option available in MySQL interface provided by hosting provider (GoDaddy)

4) I have also taken a manual backup of the complete site using FTP before upgrading

5) I do not know how to take backup/dump of the DB using Phpmyadmin hence I could not take that backup (sorry)  :(

 

Some more details: while trying to fix this issue, I have been reading a lot of other threads and forums and one of them had mentioned that this new version of Prestashop has a feature to disable/delete a specific menu item also and I assumed that if I delete the 'Feature' sub-menu under "Products" might fix this issue; I went ahead and deleted the sub-menu but unfortunately there is no change. I still get the same issue.

 

Please help.... let me know if you need any more details of information before you could help me out.

 

If you want I can share the latest DB backup that is being used as of now and also the old DB back which I have been taking from time to time. 

Edited by V-5 (see edit history)
Link to comment
Share on other sites

Restored the backup using MySQL interface given by my hosting provider.

I login to Myphp console and select import, select the backed up database to import and hit import.

After a few minutes I get message import done successful.

 

See screenshot below.

post-572356-0-73737800-1506587090_thumb.jpg

Edited by V-5 (see edit history)
Link to comment
Share on other sites

  • 2 months later...
On 9/28/2017 at 6:06 PM, musicmaster said:

Let's see how that works.

 

If you don't succeed I can have a look myself. For that I would need you to pm me access data.

Hello,

 

Sorry for not replying for so long.

 

Got stuck in other projects and ended up neglecting my own site.

Please let me know what access you need and I will have it setup for you.

I need to get my site up and running again at the earliest.

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...