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

Field category_permissions_field does not exists in mapping #2861

Open
vetalkab opened this issue Mar 6, 2023 · 9 comments
Open

Field category_permissions_field does not exists in mapping #2861

vetalkab opened this issue Mar 6, 2023 · 9 comments
Assignees

Comments

@vetalkab
Copy link

vetalkab commented Mar 6, 2023

Hi,
After Magento Upgrade we found that public graphql query for products is failing

HTTP Status Code is 200 but response says "message": "Internal server error".

After digging into the logs we found such an error:

Field category_permissions_field does not exists in mapping

### Preconditions

We just deployed Magento EE Upgrade 2.4.5-p1 to production on Magento Cloud and switched from elasticsearch to Opensearch 1.2

Magento Version : 2.4.5-p1 EE
ElasticSuite Version : 2.10.13.3
Environment : Production

@romainruaud
Copy link
Collaborator

Hi @vetalkab

I guess your website relies on the "category permission" feature of Magento ? Some categories are visible only for particular customers, something like that ?

From which version did you upgrade ?

Do you have a more detailed stacktrace from your log file ? I'd like to see from where this error is triggered.

Regards

@vetalkab
Copy link
Author

vetalkab commented Mar 7, 2023

Hi @romainruaud
Yes, our site relies on the "category permission" feature of Magento. Different customer groups have a different level of access to the categories.
We upgraded Magento from version 2.4.3-p3 to version 2.4.5-p1

The only error we get in system.log is:
`[2023-03-06T19:22:26.388938+00:00] report.ERROR: Field category_permissions_field does not exists in mapping

GraphQL (18:13)
17: name
18: products(
^
19: pageSize: 10,
[] []`

On this project we also use smile/module-elasticsuite-cms-search and smile/module-elasticsuite-quick-order.

We also managed to reproduce the issue on another test server, not on magento.cloud and there is used Elasticsearch Version 1.17

Also Magento Support provided such feedback:
We have investigated the issue and we were able to reproduce the issue over your production dumps. Please find the below information from the issue investigation.

Cause of the issue: Smile_ElasticsuiteCore, Smile_ElasticsuiteCatalog, Smile_ElasticsuiteCatalogGraphQl 3rd party modules

After disabling the modules, the issue has been resolved and I was able to get the intended output.
magento-support
Please verify the root cause by disabling the Smile_ElasticsuiteCore, Smile_ElasticsuiteCatalog, Smile_ElasticsuiteCatalogGraphQ extensions. And contact the Smile_ElasticsuiteCore module developers to get the issue fixed.

Hope this data help in the investigation.

Thank you for the quick response.

Regards,
Vitalii

@romainruaud
Copy link
Collaborator

Hello,

I think you might need to add the category_permissions_field as a filterable field for Elasticsuite, like it's done here for the url_key :

https://github.com/Smile-SA/elasticsuite/blob/2.10.x/src/module-elasticsuite-catalog-graph-ql/etc/elasticsuite_indices.xml#L24

And then clean the cache and proceed with a full reindex.

@vetalkab
Copy link
Author

vetalkab commented Mar 7, 2023

Hi @romainruaud
Thank you for the suggested solution however this fix doesn't help.
In order to fix the issue we had to disable plugin \Magento\ElasticsearchCatalogPermissionsGraphQl\Plugin\CatalogGraphQl\ProductSearchCriteriaFilter
disable-catalog-permissions-graphql-incompatible-smile-elasticsuite.patch

We also managed to replicate this issue on another project Magento 2.4.5-p1, with your module and B2B.

Regards,
Vitalii

@vahonc vahonc assigned romainruaud and unassigned vetalkab Mar 13, 2023
@karthik147
Copy link

karthik147 commented Jun 13, 2023

Hi @romainruaud

The reported error disappeared, but the product query results become empty after adding the mapping fields.

I tried adding the mapping field like "category_permissions_field" && "category_permissions_value" after reindexing and cleaning the cache. the product results become empty.

image

After adding fields as filterable:
image

@bgorski
Copy link

bgorski commented Jul 2, 2023

Hi @romainruaud, I can confirm that this happens on a clean Magento 2.4.6 with ElasticSuite installed as well. Even with category_permissions_value and category_permissions_field added as filterable the result is empty, because the fields corresponding to catalog permissions that are indexed on clean Magento are no longer indexed with ElasticSuite enabled.
This is what exists in the index on clean Magento:
image
Those fields consist of the "category_permission_" string followed by a store ID and a customer group ID (\Magento\ElasticsearchCatalogPermissions\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryPermission for reference).
On ElasticSuite product indexes they're not there, so filtering by them results in an empty set being returned.

@barbazul
Copy link
Contributor

I am having exactly the same issue. In our case we are going the other way: We want to start leveraging category permissions and events

Magento 2.4.6-p3
ElasticSuite: 2.11.4.2

@edwinbos
Copy link

Kind of the same problem, but on Open Source, without any additional modules and not in the GraphQL, but while using a filter on the frontend.

Field directly_available does not exists in mapping

Magento ver. 2.4.6-p3
ElasticSuite Open Source ver. 2.11.4.1

@mahesh-makwana-web-vision

Any updates here? My filter also causes issues when I set my custom attribute to non-filterable.

Field XXXXXXXXXX does not exists in mapping

Magento ver. 2.4.7-p3
[ElasticSuite] Open Source ver. 2.11.6.1 (on elasticsearch ver. 7.17.26)

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

No branches or pull requests

7 participants