Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrade to magento 2.3.2 site broken #1442

Closed
a970032 opened this issue Jun 26, 2019 · 28 comments
Closed

After upgrade to magento 2.3.2 site broken #1442

a970032 opened this issue Jun 26, 2019 · 28 comments
Assignees
Labels

Comments

@a970032
Copy link

a970032 commented Jun 26, 2019

Preconditions

Magento Version : magento 2.3.2

ElasticSuite Version :2.8.0

Environment :Developer

Third party modules :

Steps to reproduce

  1. composer require "magento/magento-cloud-metapackage":"2.3.2" --no-update
  2. bin/magento setup:upgrade
  3. 500 error Fatal Error: 'Class 'Magento\CatalogInventory\Model\Plugin\Layer' not found' in '/var/www/vhosts/default/vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Plugin/LayerPlugin.php' on line 25

Expected result

  1. can normally go to home page

Actual result

<error>
<messages>
<error>
<data_item>
<code>500</code>
<message>
<![CDATA[
Fatal Error: 'Class 'Magento\CatalogInventory\Model\Plugin\Layer' not found' in '/var/www/vhosts/default/vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Plugin/LayerPlugin.php' on line 25
]]>
</message>
<trace>
<![CDATA[ Trace is not available. ]]>
</trace>
</data_item>
</error>
</messages>
</error>

image

@sweikenb
Copy link

Same here, as it seems they removed the Layer-plugin entirely from the source:

https://github.com/magento/magento2/tree/2.3.2/app/code/Magento/CatalogInventory/Model/Plugin

@sweikenb
Copy link

A quick fix for this is to disable the plugin, this would have other consequences regarding the displaying of the stock status, but at least the site isn't down:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!--
    Temporary Quick-Fix to prevent the site to be down:
    https://github.com/Smile-SA/elasticsuite/issues/1442
    -->
    <type name="Magento\Catalog\Model\Layer">
        <plugin name="addStockStatusOnPrepareFrontCollection"
                type="Smile\ElasticsuiteCatalog\Plugin\LayerPlugin"
                disabled="true"/>
    </type>
</config>

NathMorgan added a commit to NathMorgan/elasticsuite that referenced this issue Jun 26, 2019
Magento 2.3.2 removed this plugin
@NathMorgan
Copy link

Created PR that should fix this issue #1444

@Quazz
Copy link

Quazz commented Jun 26, 2019

Layered navigation will still be entirely broken even if you do this.

Looks like this commit is what removed the layer plugin and changed the logic:

magento/magento2@9ab466d#diff-2ad66624cecd33a368d784f2be936f48

@southerncomputer
Copy link
Contributor

#1445 (comment) see this thread

@romainruaud
Copy link
Collaborator

Thank you @NathMorgan for your PR.

as far as I can see, it could do the trick. I did not test it by myself however.

@androshchuk can you have a look on this issue and associated PR ?

Regards

@kleestb
Copy link

kleestb commented Jul 3, 2019

Unfortunately #1448 did not work for us and we desperately need to have a working version. When can we expect a fix?

@grudado
Copy link

grudado commented Jul 3, 2019

@kleestb did you try to restore the layer plugin ?
#1445

@kirmorozov
Copy link

It's weird, that Magento fellows allowed removal of the code without any prior notice, as pert of minor release.

@hanhpv
Copy link

hanhpv commented Jul 4, 2019

Same issue

@southerncomputer
Copy link
Contributor

What is the issue you are getting after applying the patch?

@bytes-commerce
Copy link

Same issue on Vanilla Magento 2.3.2, ES 6.1.8 and Module 2.8.0

@southerncomputer
Copy link
Contributor

did you apply this patch and the #1444 patch as well?!

@bytes-commerce
Copy link

Hi @southerncomputer, I'll apply the patch and revert further changes that I made in order to solve this. I'll let you know quickly.

@bytes-commerce
Copy link

@southerncomputer after reindexing (as I said, fresh install, Data Migration has been done, tho):

1 exception(s):
Exception #0 (LogicException): catalog_product index does not exist yet. Make sure everything is reindexed.

@southerncomputer
Copy link
Contributor

did you get this error after doing bin/magento indexer:reindex ?

@bytes-commerce
Copy link

Yes, exactly. I made some calls to ES to check for active indicies and found only those. The numbers look to small. There are ~6k Products in the DB currently.

 www-data@local:~/magento2$ curl -X GET "elasticsearch:9200/_cat/indices?v"
health status index                                             uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   magento2_product_1_v1                             qBm5TNDLQzi5gTPM-SPxkA   5   1       2932            0      3.4mb          3.4mb
green  open   magento2_default_catalog_category_20190706_140456 ajZESosKRCi4okyFUPbR7A   1   0        680            0        1mb            1mb
green  open   magento2_default_thesaurus_20190706_140458        OWeLSlbSTsqx_DFRreE4Yg   1   0          0            0       261b           261b

@southerncomputer
Copy link
Contributor

southerncomputer commented Jul 6, 2019

It sounds like your product indexing is crashing/getting stuck! Might turn on var/log/debug.log and tail it while its doing indexing!
on my dev box it is showing

green  open   magento2_default_catalog_product_20190706_050716  zsB-28XjRfWbMzG6NfXN8g   1   0   12301172            0     12.4gb         12.4gb

I know elasticsuite builds indexes with a temp name and then renames it as it completes successfully!

p.s. i think magento2_product_1_v1 is created from the built-in elasticsearch not elasticsuite!

@bytes-commerce
Copy link

bytes-commerce commented Jul 6, 2019

Thanks for that hint with the Magento ElasticSearch Engine, that actually was an issue of not setting the Source to ElasticSuite, there should be a check that looks out for correct settings and if not, advises the user to apply correct settings.

So generally, after applying both pathes -> it worked.

@romainruaud
Copy link
Collaborator

Good to know !

I'll work on this one this week.

But for me, the plugin can be removed, since the Stock management is now done with a search context filter :

https://github.com/Smile-SA/elasticsuite/blob/2.8.x/src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/Stock.php

@romainruaud
Copy link
Collaborator

Fixed by PR #1461

@marvinhinz
Copy link

Thanks! Could create a new release with this merge?

@skazhikadyadya
Copy link

A quick fix for this is to disable the plugin, this would have other consequences regarding the displaying of the stock status, but at least the site isn't down:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!--
    Temporary Quick-Fix to prevent the site to be down:
    https://github.com/Smile-SA/elasticsuite/issues/1442
    -->
    <type name="Magento\Catalog\Model\Layer">
        <plugin name="addStockStatusOnPrepareFrontCollection"
                type="Smile\ElasticsuiteCatalog\Plugin\LayerPlugin"
                disabled="true"/>
    </type>
</config>

Hi, excuse me, how i can implement that XML? Thanks.

@skazhikadyadya
Copy link

skazhikadyadya commented Jul 11, 2019

Some problem.

[m2@shop public_html]$ bin/magento module:enable Smile_ElasticsuiteCore Smile_ElasticsuiteCatalog Smile_ElasticsuiteSwatches Smile_ElasticsuiteCatalogRule Smile_ElasticsuiteVirtualCategory Smile_ElasticsuiteThesaurus Smile_ElasticsuiteCatalogOptimizer Smile_ElasticsuiteTracker
PHP Fatal error:  Class 'Magento\CatalogInventory\Model\Plugin\Layer' not found in /home/mirkada/web/shop.m2.com/public_html/vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Plugin/LayerPlugin.php on line 25

Latest M2. How I can quickly fix that? Thanks.

@iozkn
Copy link

iozkn commented Jul 11, 2019

@skazhikadyadya I fix like this;

$ composer remove smile/elasticsuite 
$ composer require smile/elasticsuite 2.8.x-dev

@romainruaud
Copy link
Collaborator

@roman204 as far as I know there is no 3.0 version.

Where did you find it ?

@romainruaud
Copy link
Collaborator

It's elasticsuite here... not magesuite...

@olivercastro
Copy link

@romainruaud
use this
composer require creativestyle/magesuite ^3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests