I am getting below error while saving category. This error are from log file.
[2019年01月18日 12:03:51] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'a76e6b4a_demo.amasty_xsearch_category_fulltext_cl' doesn't exist, query was: INSERT INTO
catalog_category_entity_varchar(entity_id,attribute_id,store_id,value) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATEentity_id= VALUES(entity_id),attribute_id= VALUES(attribute_id),store_id= VALUES(store_id),value= VALUES(value) {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'a76e6b4a_demo.amasty_xsearch_category_fulltext_cl' doesn't exist, query was: INSERT INTOcatalog_category_entity_varchar(entity_id,attribute_id,store_id,value) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATEentity_id= VALUES(entity_id),attribute_id= VALUES(attribute_id),store_id= VALUES(store_id),value= VALUES(value) at/chroot/home/a76e6b4a/buildersbook.com/html/demo/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'a76e6b4a_demo.amasty_xsearch_category_fulltext_cl' doesn't exist at /chroot/home/a76e6b4a/buildersbook.com/html/demo/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []
I have installed Amasty Xsearch extension before which I already removed and have been executed below commands too.
rm -rf var/cache/ var/page_cache/ var/view_preprocessed/ pub/static/frontend/ pub/static/adminhtml/
php -dmemory_limit=8G bin/magento cache:clean
php -dmemory_limit=8G bin/magento cache:flush
php -dmemory_limit=8G bin/magento setup:upgrade
php -dmemory_limit=8G bin/magento setup:di:compile
php -dmemory_limit=8G bin/magento indexer:reset
php -dmemory_limit=8G bin/magento indexer:reindex
php -dmemory_limit=8G bin/magento setup:static-content:deploy -f
I also give below permissions to my files and folders:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
2 Answers 2
You have added prefix to your database tables 'a76e6b4a_demo' and in Amasty module table name is written statically so it is throwing an error. You can use below code for table names:
$resource is an object of Magento\Framework\App\ResourceConnection
$this->_resource = $resource;
$connection=$this->_resource->getConnection();
$tableName=$connection->getTableName(YOUR_TABLENAME); // It will return "TablePrefix_YOUR_TABLENAME"
Maybe you didnt installed the Amasty Extension properly. Are you installing it through composer ? If so check if your version is community / enterprise .
Do a composer remove of the current one
composer remove amasty/xsearch --clear-static-content
(check if it has dependencies)
For community
composer config repositories.amasty composer https://composer.amasty.com/community/
composer require amasty/xsearch
For Enterprise
composer config repositories.amasty composer https://composer.amasty.com/enterprice/
composer require amasty/xsearch
-
Yes, I have already installed it using composer.Jaimin– Jaimin2019年01月18日 13:27:16 +00:00Commented Jan 18, 2019 at 13:27
catalog_category_entity_varcharfrom that extension: mysqltutorial.org/managing-trigger-in-mysql.aspx