-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Mapping conflict exception not bubbling up to root cause #12839
Comments
I'm not sure if this is a bug.
We skip it on purpose, here |
I don't think it is a bug, but a choice that was made. The root_cause stops at a subclass of ElasticsearchException, I believe. Perhaps @s1monw can elaborate on why we don't go down to the original root cause (the IAE here)? |
+1 on improving exception rendering to try to better expose the actual root cause of the issue |
Does so by improving the error message passed to MapperParsingException. The error messages for mapping conflicts now look like: ``` { "error" : { "root_cause" : [ { "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [type_one]: Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]" } ], "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [type_one]: Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]", "caused_by" : { "type" : "illegal_argument_exception", "reason" : "Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]" } }, "status" : 400 } ``` Closes elastic#12839 Change implementation Rather than make a new exception this improves the error message of the old exception.
Does so by improving the error message passed to MapperParsingException. The error messages for mapping conflicts now look like: ``` { "error" : { "root_cause" : [ { "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [type_one]: Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]" } ], "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [type_one]: Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]", "caused_by" : { "type" : "illegal_argument_exception", "reason" : "Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]" } }, "status" : 400 } ``` Closes #12839 Change implementation Rather than make a new exception this improves the error message of the old exception.
Does so by improving the error message passed to MapperParsingException. The error messages for mapping conflicts now look like: ``` { "error" : { "root_cause" : [ { "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [type_one]: Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]" } ], "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [type_one]: Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]", "caused_by" : { "type" : "illegal_argument_exception", "reason" : "Mapper for [text] conflicts with existing mapping in other types:\n[mapper [text] has different [analyzer], mapper [text] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [text] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]" } }, "status" : 400 } ``` Closes #12839 Change implementation Rather than make a new exception this improves the error message of the old exception.
A mapping conflict such as:
throws an exception like:
The
error.root_cause.reason
should contain the text fromerror.type.caused_by.reason
The text was updated successfully, but these errors were encountered: