elasticsuite
elasticsuite copied to clipboard
Error during installation on Magento >=2.4.1
Preconditions
I develop in a Docker environment including Elasticsearch 7.7.1, Redis 6, PHP 7.4 and MariaDB 10.4
Magento Version : 2.4.2 EE (tested in 2.4.0 EE, 2.4.1 CE and 2.4.1 EE, too) ElasticSuite Version : 2.10.3 Environment : Developer
Third party modules :
- "cweagans/composer-patches": "^1.7"
- "magento/magento-coding-standard": "^6.0"
- "phpunit/phpunit": "~9.2.0"
Steps to reproduce
-
composer require smile/elasticsuite
-
bin/magento module:enable Smile_ElasticsuiteCore Smile_ElasticsuiteCatalog Smile_ElasticsuiteSwatches Smile_ElasticsuiteCatalogRule Smile_ElasticsuiteVirtualCategory Smile_ElasticsuiteThesaurus Smile_ElasticsuiteCatalogOptimizer Smile_ElasticsuiteTracker Smile_ElasticsuiteAnalytics Smile_ElasticsuiteAdminNotification
-
bin/magento setup:config:set --es-hosts elasticsearch:9200
-
bin/magento setup:config:set --es-enable-ssl 0
-
bin/magento setup:upgrade
Expected result
- No errors and a clean execution of the command
setup:upgrade
.
Actual result
-
Cache types config flushed successfully Cache cleared successfully File system cleanup: /var/www/default/generated/code/Composer /var/www/default/generated/code/Fastly /var/www/default/generated/code/Magento /var/www/default/generated/code/PayPal /var/www/default/generated/code/Psr /var/www/default/generated/code/Smile /var/www/default/generated/code/Symfony The directory '/var/www/default/generated/metadata/' doesn't exist - skipping cleanup Updating modules: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.smile_virtualcategory_catalog_category_product_position' doesn't exist, query was: CREATE TRIGGER trg_smile_virtualctgr_cat_ctgr_prd_position_after_insert AFTER INSERT ON smile_virtualcategory_catalog_category_product_position FOR EACH ROW BEGIN INSERT IGNORE INTO ``catalogsearch_fulltext_cl`` (``entity_id``) VALUES (NEW.``product_id``); END
- If you run
setup: upgrade
again after this error, it will go through without errors. However, the trigger is then not created in the table.
I have the same issue. I followed the installation instructions page but it's more than 1 year old, I'm wondering if it's missing something from the most recent version of ElasticSuite. Anyway trying to use the module ignoring that error eventually I get issues in the category page in the backend "catalog_product index does not exist yet. Make sure everything is reindexed." [edit: the search engine was reverted back to elasticsearch7 instead of elasticsuite, changing that the category page works] And trying to reindex some indexes fail with "Port must be configured within host parameter", mainly because the database crashes. So I'm not sure what could be wrong.
It looks like the Magento Mview mechanism is trying to create triggers before the table is really created.
Did you give a try to :
- set indexers to "update on save"
- do the setup:upgrade
- set indexers back to "update on schedule", which should create the appropriate triggers
It might be a workaround for now, until searching for additional insights
It looks like the Magento Mview mechanism is trying to create triggers before the table is really created.
Did you give a try to :
- set indexers to "update on save"
- do the setup:upgrade
- set indexers back to "update on schedule", which should create the appropriate triggers
It might be a workaround for now, until searching for additional insights
@romainruaud That works for me. But it would be nice if you didn't need this step.
I would suggest moving all table information to db_schema.xml
, and removing setup scripts.
Fixed on master. Will be part of next major release 2.11.0
@romainruaud please can you share some details about how this is being fixed? I understood this is a bug in Magento (with a fix in https://github.com/magento/magento2/pull/33092). I can't easily see any pull requests or commits that reference this issue.
On master all the tables creations have been moved to db_schema.xml
As suggested per @pykettk and done in https://github.com/Smile-SA/elasticsuite/pull/2148
This is supposed to fix this issue.
Any workaround for Magento < 2.4.6? This fix won't be backported to 2.10.x if I understand correctly? We're planning to deploy ElasticSuite with Magento 2.4.5 and then upgrade to 2.4.6 in a second phase, but we hit this bug and it's kinda nogo :(
@xi-ao you can back-port https://github.com/magento/magento2/pull/33092
Hi @romainruaud,
FYI: We installed Elastic Suite 2.11.3.2 on Magento Open Source 2.4.6-p2, and we still got the error on running bin/magento setup:upgrade
if the indexers are set to "Update on Schedule".
When applying https://github.com/magento/magento2/pull/33092/files using a Composer patch, the upgrade finishes and the trigger can be found in the database:
Well seems we have to wait for 2.4.7 then :D