2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND mv.store_id=1) GROUP BY `entity_id` ORDER BY `max_loged` DESC
LIMIT 15' at line 5, query was: SELECT DISTINCT `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position`, `mv`.*, MAX(logged_at) AS `max_loged`, COUNT(`event_id`) AS `num_view_counts`, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='2'
LEFT JOIN `report_event` AS `mv` ON mv.object_id = e.entity_id
LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 WHERE (mv.event_type_id = 1 AND mv.subject_id= AND mv.store_id=1) GROUP BY `entity_id` ORDER BY `max_loged` DESC
LIMIT 15
Exception #1 (PDOException): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND mv.store_id=1) GROUP BY `entity_id` ORDER BY `max_loged` DESC
LIMIT 15' at line 5
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND mv.store_id=1) GROUP BY `entity_id` ORDER BY `max_loged` DESC
LIMIT 15' at line 5, query was: SELECT DISTINCT `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position`, `mv`.*, MAX(logged_at) AS `max_loged`, COUNT(`event_id`) AS `num_view_counts`, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='2'
LEFT JOIN `report_event` AS `mv` ON mv.object_id = e.entity_id
LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 WHERE (mv.event_type_id = 1 AND mv.subject_id= AND mv.store_id=1) GROUP BY `entity_id` ORDER BY `max_loged` DESC
LIMIT 15
#0 /home/domain/domains/domain.com/public_html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(93): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/domain/domains/domain.com/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#2 /home/domain/domains/domain.com/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/domain/domains/domain.com/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT DISTINCT...', Array)
#4 /home/domain/domains/domain.com/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(533): Zend_Db_Adapter_Pdo_Abstract->query('SELECT DISTINCT...', Array)
#5 /home/domain/domains/domain.com/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(605): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('SELECT DISTINCT...', Array)
#6 /home/domain/domains/domain.com/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Select), Array)
#7 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php(21): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\Framework\DB\Select), Array)
#8 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Data/Collection/AbstractDb.php(774): Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll(Object(Magento\Framework\DB\Select), Array)
#9 /home/domain/domains/domain.com/public_html/vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php(1115): Magento\Framework\Data\Collection\AbstractDb->_fetchAll(Object(Magento\Framework\DB\Select))
#10 /home/domain/domains/domain.com/public_html/vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php(913): Magento\Eav\Model\Entity\Collection\AbstractCollection->_loadEntities(false, false)
#11 /home/domain/domains/domain.com/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php(777): Magento\Eav\Model\Entity\Collection\AbstractCollection->load(false, false)
#12 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Catalog\Model\ResourceModel\Product\Collection->load(false, false)
#13 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->___callParent('load', Array)
#14 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->Magento\Framework\Interception\{closure}()
#15 /home/domain/domains/domain.com/public_html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Collection/Interceptor.php(26): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->___callPlugins('load', Array, Array)
#16 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Data/Collection.php(842): Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->load()
#17 /home/domain/domains/domain.com/public_html/app/design/frontend/Sm/destino/Sm_RecentlyViewed/templates/default.phtml(16): Magento\Framework\Data\Collection->count()
#18 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/home/domain/dom...')
#19 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Sm\RecentlyViewed\Block\RecentlyViewed\Interceptor), '/home/domain/dom...', Array)
#20 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/home/domain/dom...')
#21 /home/domain/domains/domain.com/public_html/app/code/Sm/RecentlyViewed/Block/RecentlyViewed.php(179): Magento\Framework\View\Element\Template->_toHtml()
#22 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(667): Sm\RecentlyViewed\Block\RecentlyViewed->_toHtml()
#23 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Element\AbstractBlock->toHtml()
#24 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(533): Magento\Framework\View\Layout->_renderBlock('recentlyviewed....')
#25 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('recentlyviewed....')
#26 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('recentlyviewed....')
#27 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('recentlyviewed....', false)
#28 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('recentlyviewed....', false)
#29 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('before.body.end', false)
#30 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('before.body.end')
#31 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('before.body.end')
#32 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('before.body.end', false)
#33 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('before.body.end', false)
#34 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false)
#35 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#36 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper')
#37 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.wrapper', false)
#38 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper', false)
#39 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('root', false)
#40 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('root')
#41 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root')
#42 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('root', true)
#43 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Layout.php(954): Magento\Framework\View\Layout\Interceptor->renderElement('root')
#44 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput()
#45 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', Array)
#46 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}()
#47 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(494): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#48 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Result/Page.php(257): Magento\Framework\View\Layout\Interceptor->getOutput()
#49 /home/domain/domains/domain.com/public_html/vendor/magento/framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#50 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#51 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#52 /home/domain/domains/domain.com/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#53 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(39): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#54 /home/domain/domains/domain.com/public_html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#55 /home/domain/domains/domain.com/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#56 /home/domain/domains/domain.com/public_html/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http\Interceptor->launch()
#57 /home/domain/domains/domain.com/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#58 {main}
Hello @drakasmag,
There is look like SQL syntax error. Please debug it because we need to check database.
--
If my answer is useful, please Accept as Solution & give Kudos
Hello. Thanks for reply. How to debug it?
Added database dump: https://we.tl/t-58ydQzd64V