-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Index Management] Index mappings details page gets broken from an unsupported data type counted_keyword
#197592
Comments
Pinging @elastic/kibana-management (Team:Kibana Management) |
According to elastic/elasticsearch#101826, this new type is considered experimental and therefore not publicly documented. We should probably wait until documentation is available before supporting it in Kibana. cc: @alisonelizabeth Edit: We could still resolve this bug by better handling unsupported types. |
Let's discuss this. In this case, the mappings editor is being used to view index mappings in which case I think we would want to support it. However, I agree, that we may want to wait before adding the ability to add this mapping type via the index/component template UIs. |
Yes, that makes sense to me! We can still display the unrecognized type in the editor: In fact, an unrecognized type can also be added through the UI, using the "Other" type option. |
Fixes elastic#197592 ## Summary This PR fixes the bug where the index Mappings details page crashes if the index has a mapping field with a type that is not recognized in Kibana. We fix this by using `getTypeLabelFromField` instead of directly fetching the `label` property of an object that might be `undefined` - `getTypeLabelFromField` takes care of this case. **How to test:** 1. Create the following index in Console (it has the unsupported `counted_keyword` field type): ``` PUT test { "mappings": { "properties": { "@timestamp": { "type": "date" }, "log": { "type": "text" }, "ids": { "type": "counted_keyword" } } } } ``` 2. Go to Index Management and click on the index that we just created 3. Go to Mappings tab 4. Verify that the page loads correctly 5. Check that the opening filter and selecting an option doesn't make the page crash. https://github.com/user-attachments/assets/4a595968-7cd8-4d36-9a53-264a0d5db50f (cherry picked from commit 3c5319f)
How to reproduce:
Request to create index:
Error in console:
This error seems to come from this line:
kibana/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx
Line 59 in 1c3705b
It probably fails because of an unsupported data type. I looked through the mappings and noticed one mapping with type
counted_keyword
which is not in the supported ones:To see if this is the cause, I created a new index with the same mappings but removed this specific one. Then verified that the Mappings details page loads and works as expected.
The text was updated successfully, but these errors were encountered: