Jump to content

ERREUR 500 sur de nombreuses requêtes


Recommended Posts

Bonjour à tous,

 

Bon j'ai un pronlème depuis quelques heures:

Lorsque je souhaite aller dans l'onglet "client"

HTTP 500 Internal Server Error
An exception occurred while executing 'SELECT c.id_customer, c.firstname, c.lastname, c.email, c.active, c.newsletter, c.optin, c.date_add, gl.name as social_title, s.name as shop_name, c.company, (SELECT SUM(total_paid_real / conversion_rate) FROM vnud_orders o WHERE (o.id_customer = c.id_customer) AND (o.id_shop IN (?)) AND (o.valid = 1)) as total_spent, (SELECT c.date_add FROM vnud_guest g LEFT JOIN vnud_connections con ON con.id_guest = g.id_guest WHERE g.id_customer = c.id_customer ORDER BY c.date_add DESC LIMIT 1) as connect FROM vnud_customer c LEFT JOIN vnud_gender_lang gl ON c.id_gender = gl.id_gender AND gl.id_lang = ? LEFT JOIN vnud_shop s ON c.id_shop = s.id_shop WHERE (c.deleted = 0) AND (c.id_shop IN (?)) ORDER BY c.date_add DESC LIMIT 50 OFFSET 0' with params [1, 2, 1]:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db813224222.vnud_guest' doesn't exist

Pareil pour l'onglet "panier"

Table 'db813224222.vnud_connections' doesn't exist


SELECT a.`id_cart`, a.`date_add` AS `date_add`
, CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) `customer`, a.id_cart total, ca.name carrier, o.id_order,
		IF (IFNULL(o.id_order, 'Non commandé') = 'Non commandé', IF(TIME_TO_SEC(TIMEDIFF('2020-04-02 17:14:00', a.`date_add`)) > 86400, 'Panier abandonné', 'Non commandé'), o.id_order) AS status, IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest, shop.name as shop_name 
FROM `vnud_cart` a 

LEFT JOIN vnud_customer c ON (c.id_customer = a.id_customer)
		LEFT JOIN vnud_currency cu ON (cu.id_currency = a.id_currency)
		LEFT JOIN vnud_carrier ca ON (ca.id_carrier = a.id_carrier)
		LEFT JOIN vnud_orders o ON (o.id_cart = a.id_cart)
		LEFT JOIN (
            SELECT `id_guest`
            FROM `vnud_connections`
            WHERE
                TIME_TO_SEC(TIMEDIFF('2020-04-02 17:14:00', `date_add`)) < 1800
            LIMIT 1
       ) AS co ON co.`id_guest` = a.`id_guest` 
 LEFT JOIN `vnud_shop` shop
                            ON a.`id_shop` = shop.`id_shop` WHERE 1  AND a.id_shop IN (1) 

 ORDER BY a.id_cart DESC  LIMIT 0, 50

at line 769 in file classes/db/Db.php
764.         if ($webservice_call && $errno) {
765.             $dbg = debug_backtrace();
766.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97);
767.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
768.             if ($sql) {
769.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>');
770.             }
771. 
772.             throw new PrestaShopDatabaseException($this->getMsgError());
773.         }
774.     }

Et la même chose pour l'onglet "statistique"

Table 'db813224222.vnud_connections' doesn't exist


SELECT LEFT(date_add, 10) as fix_date, COUNT(*) as visits
				FROM vnud_connections c
				WHERE c.date_add BETWEEN  '2020-02-01 00:00:00' AND '2020-02-28 23:59:59' 
				 AND c.id_shop IN (1) 
				GROUP BY LEFT(date_add, 10)

at line 769 in file classes/db/Db.php
764.         if ($webservice_call && $errno) {
765.             $dbg = debug_backtrace();
766.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97);
767.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
768.             if ($sql) {
769.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>');
770.             }
771. 
772.             throw new PrestaShopDatabaseException($this->getMsgError());
773.         }
774.     }

Si je comprends bien il me dit que les bases n'existent pas ?

 

Comment résoudre tout ca ?

 

Merci d'avance 

Bonne soirée

Link to comment
Share on other sites

DROP TABLE IF EXISTS `ps_connections`;
CREATE TABLE `ps_connections` (
  `id_connections` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id_shop_group` int(11) unsigned NOT NULL DEFAULT '1',
  `id_shop` int(11) unsigned NOT NULL DEFAULT '1',
  `id_guest` int(10) unsigned NOT NULL,
  `id_page` int(10) unsigned NOT NULL,
  `ip_address` bigint(20) DEFAULT NULL,
  `date_add` datetime NOT NULL,
  `http_referer` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_connections`),
  KEY `id_guest` (`id_guest`),
  KEY `date_add` (`date_add`),
  KEY `id_page` (`id_page`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `ps_connections_page`;
CREATE TABLE `ps_connections_page` (
  `id_connections` int(10) unsigned NOT NULL,
  `id_page` int(10) unsigned NOT NULL,
  `time_start` datetime NOT NULL,
  `time_end` datetime DEFAULT NULL,
  PRIMARY KEY (`id_connections`,`id_page`,`time_start`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `ps_connections_source`;
CREATE TABLE `ps_connections_source` (
  `id_connections_source` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id_connections` int(10) unsigned NOT NULL,
  `http_referer` varchar(255) DEFAULT NULL,
  `request_uri` varchar(255) DEFAULT NULL,
  `keywords` varchar(255) DEFAULT NULL,
  `date_add` datetime NOT NULL,
  PRIMARY KEY (`id_connections_source`),
  KEY `connections` (`id_connections`),
  KEY `orderby` (`date_add`),
  KEY `http_referer` (`http_referer`),
  KEY `request_uri` (`request_uri`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `ps_guest`;
CREATE TABLE `ps_guest` (
  `id_guest` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id_operating_system` int(10) unsigned DEFAULT NULL,
  `id_web_browser` int(10) unsigned DEFAULT NULL,
  `id_customer` int(10) unsigned DEFAULT NULL,
  `javascript` tinyint(1) DEFAULT '0',
  `screen_resolution_x` smallint(5) unsigned DEFAULT NULL,
  `screen_resolution_y` smallint(5) unsigned DEFAULT NULL,
  `screen_color` tinyint(3) unsigned DEFAULT NULL,
  `sun_java` tinyint(1) DEFAULT NULL,
  `adobe_flash` tinyint(1) DEFAULT NULL,
  `adobe_director` tinyint(1) DEFAULT NULL,
  `apple_quicktime` tinyint(1) DEFAULT NULL,
  `real_player` tinyint(1) DEFAULT NULL,
  `windows_media` tinyint(1) DEFAULT NULL,
  `accept_language` varchar(8) DEFAULT NULL,
  `mobile_theme` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_guest`),
  KEY `id_customer` (`id_customer`),
  KEY `id_operating_system` (`id_operating_system`),
  KEY `id_web_browser` (`id_web_browser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Remplacez ps_ par le préfixe de vos tables^^

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