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

[Index Management] Index mappings details page gets broken from an unsupported data type counted_keyword #197592

Closed
ElenaStoeva opened this issue Oct 24, 2024 · 4 comments · Fixed by #198185
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Mappings Editor Index mappings editor UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@ElenaStoeva
Copy link
Contributor

ElenaStoeva commented Oct 24, 2024

How to reproduce:

  1. Create the following index with mappings in Console:
Request to create index:
PUT test
{
  "mappings": {
    "dynamic": "true",
    "_data_stream_timestamp": {
      "enabled": true
    },
    "dynamic_templates": [
      {
        "numeric_labels": {
          "path_match": "numeric_labels.*",
          "mapping": {
            "scaling_factor": 1000000,
            "type": "scaled_float"
          }
        }
      },
      {
        "ecs_timestamp": {
          "match": "@timestamp",
          "mapping": {
            "ignore_malformed": false,
            "type": "date"
          }
        }
      },
      {
        "ecs_message_match_only_text": {
          "path_match": [
            "message",
            "*.message"
          ],
          "unmatch_mapping_type": "object",
          "mapping": {
            "type": "match_only_text"
          }
        }
      },
      {
        "ecs_non_indexed_keyword": {
          "path_match": "event.original",
          "mapping": {
            "doc_values": false,
            "index": false,
            "type": "keyword"
          }
        }
      },
      {
        "ecs_non_indexed_long": {
          "path_match": "*.x509.public_key_exponent",
          "mapping": {
            "doc_values": false,
            "index": false,
            "type": "long"
          }
        }
      },
      {
        "ecs_ip": {
          "path_match": [
            "ip",
            "*.ip",
            "*_ip"
          ],
          "match_mapping_type": "string",
          "mapping": {
            "type": "ip"
          }
        }
      },
      {
        "ecs_wildcard": {
          "path_match": [
            "*.io.text",
            "*.message_id",
            "*registry.data.strings",
            "*url.path"
          ],
          "unmatch_mapping_type": "object",
          "mapping": {
            "type": "wildcard"
          }
        }
      },
      {
        "ecs_path_match_wildcard_and_match_only_text": {
          "path_match": [
            "*.body.content",
            "*url.full",
            "*url.original"
          ],
          "unmatch_mapping_type": "object",
          "mapping": {
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            },
            "type": "wildcard"
          }
        }
      },
      {
        "ecs_match_wildcard_and_match_only_text": {
          "match": [
            "*command_line",
            "*stack_trace"
          ],
          "unmatch_mapping_type": "object",
          "mapping": {
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            },
            "type": "wildcard"
          }
        }
      },
      {
        "ecs_path_match_keyword_and_match_only_text": {
          "path_match": [
            "*.title",
            "*.executable",
            "*.name",
            "*.working_directory",
            "*.full_name",
            "*file.path",
            "*file.target_path",
            "*os.full",
            "email.subject",
            "vulnerability.description",
            "user_agent.original"
          ],
          "unmatch_mapping_type": "object",
          "mapping": {
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            },
            "type": "keyword"
          }
        }
      },
      {
        "ecs_date": {
          "path_match": [
            "*.timestamp",
            "*_timestamp",
            "*.not_after",
            "*.not_before",
            "*.accessed",
            "created",
            "*.created",
            "*.installed",
            "*.creation_date",
            "*.ctime",
            "*.mtime",
            "ingested",
            "*.ingested",
            "*.start",
            "*.end",
            "*.indicator.first_seen",
            "*.indicator.last_seen",
            "*.indicator.modified_at",
            "*threat.enrichments.matched.occurred"
          ],
          "unmatch_mapping_type": "object",
          "mapping": {
            "type": "date"
          }
        }
      },
      {
        "ecs_path_match_float": {
          "path_match": [
            "*.score.*",
            "*_score*"
          ],
          "path_unmatch": "*.version",
          "unmatch_mapping_type": "object",
          "mapping": {
            "type": "float"
          }
        }
      },
      {
        "ecs_usage_double_scaled_float": {
          "path_match": "*.usage",
          "match_mapping_type": [
            "double",
            "long",
            "string"
          ],
          "mapping": {
            "scaling_factor": 1000,
            "type": "scaled_float"
          }
        }
      },
      {
        "ecs_geo_point": {
          "path_match": "*.geo.location",
          "mapping": {
            "type": "geo_point"
          }
        }
      },
      {
        "ecs_flattened": {
          "path_match": [
            "*structured_data",
            "*exports",
            "*imports"
          ],
          "match_mapping_type": "object",
          "mapping": {
            "type": "flattened"
          }
        }
      },
      {
        "all_strings_to_keywords": {
          "match_mapping_type": "string",
          "mapping": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      }
    ],
    "properties": {
      "@timestamp": {
        "type": "date",
        "ignore_malformed": false
      },
      "agent": {
        "properties": {
          "activation_method": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ephemeral_id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "name": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "client": {
        "properties": {
          "geo": {
            "properties": {
              "city_name": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "continent_name": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "country_iso_code": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "country_name": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "location": {
                "type": "geo_point"
              },
              "region_iso_code": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "region_name": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "ip": {
            "type": "ip"
          }
        }
      },
      "cloud": {
        "properties": {
          "account": {
            "properties": {
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "availability_zone": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "instance": {
            "properties": {
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "machine": {
            "properties": {
              "type": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "origin": {
            "properties": {
              "account": {
                "properties": {
                  "id": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              },
              "provider": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "region": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "service": {
                "properties": {
                  "name": {
                    "type": "keyword",
                    "fields": {
                      "text": {
                        "type": "match_only_text"
                      }
                    }
                  }
                }
              }
            }
          },
          "provider": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "region": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "service": {
            "properties": {
              "name": {
                "type": "keyword",
                "fields": {
                  "text": {
                    "type": "match_only_text"
                  }
                }
              }
            }
          }
        }
      },
      "container": {
        "properties": {
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "data_stream": {
        "properties": {
          "dataset": {
            "type": "constant_keyword",
            "value": "apm"
          },
          "namespace": {
            "type": "constant_keyword",
            "value": "default"
          },
          "type": {
            "type": "constant_keyword",
            "value": "traces"
          }
        }
      },
      "destination": {
        "properties": {
          "address": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ip": {
            "type": "ip"
          },
          "port": {
            "type": "long"
          }
        }
      },
      "event": {
        "properties": {
          "outcome": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "success_count": {
            "type": "byte",
            "index": false
          }
        }
      },
      "faas": {
        "properties": {
          "coldstart": {
            "type": "boolean"
          },
          "execution": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "name": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "trigger": {
            "properties": {
              "request_id": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "type": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "host": {
        "properties": {
          "architecture": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "hostname": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ip": {
            "type": "ip"
          },
          "name": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "os": {
            "properties": {
              "platform": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          }
        }
      },
      "http": {
        "properties": {
          "request": {
            "properties": {
              "body": {
                "type": "object",
                "dynamic": "false"
              },
              "cookies": {
                "type": "object",
                "dynamic": "false"
              },
              "env": {
                "properties": {
                  "REMOTE_ADDR": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "SERVER_NAME": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "SERVER_PORT": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              },
              "headers": {
                "type": "flattened"
              },
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "method": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "response": {
            "properties": {
              "decoded_body_size": {
                "type": "long",
                "index": false
              },
              "encoded_body_size": {
                "type": "long",
                "index": false
              },
              "finished": {
                "type": "boolean"
              },
              "headers": {
                "type": "flattened"
              },
              "headers_sent": {
                "type": "boolean"
              },
              "status_code": {
                "type": "long"
              },
              "transfer_size": {
                "type": "long",
                "index": false
              }
            }
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "labels": {
        "properties": {
          "aws_lambda_invoked_arn": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "aws_s3_bucket": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "aws_s3_copy_source": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "aws_s3_key": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_parameter_name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_parameter_sensitive": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_parameter_value": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_run_completed": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_run_description": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_run_result": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_run_url": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_run_user": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ci_pipeline_type": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "cloud_account_id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "faas_invocation_id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "globalID": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "host_ip": {
            "type": "ip"
          },
          "host_name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_computer_name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_pipeline_step_agent_label": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_pipeline_step_id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_pipeline_step_name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_pipeline_step_plugin_name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_pipeline_step_plugin_version": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_pipeline_step_type": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "jenkins_url": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "owner": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "service_namespace": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "session ID": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "session lock released": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "meta": {
        "properties": {
          "message_size_bytes": {
            "type": "float"
          }
        }
      },
      "numeric_labels": {
        "properties": {
          "ci_pipeline_run_durationMillis": {
            "type": "scaled_float",
            "scaling_factor": 1000000
          },
          "ci_pipeline_run_number": {
            "type": "scaled_float",
            "scaling_factor": 1000000
          },
          "session lock attempts": {
            "type": "scaled_float",
            "scaling_factor": 1000000
          }
        }
      },
      "observer": {
        "properties": {
          "hostname": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "parent": {
        "properties": {
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "process": {
        "properties": {
          "args": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "parent": {
            "properties": {
              "pid": {
                "type": "long"
              }
            }
          },
          "pid": {
            "type": "long"
          },
          "title": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          }
        }
      },
      "processor": {
        "properties": {
          "event": {
            "type": "keyword"
          }
        }
      },
      "source": {
        "properties": {
          "ip": {
            "type": "ip"
          },
          "nat": {
            "properties": {
              "ip": {
                "type": "ip"
              }
            }
          },
          "port": {
            "type": "long"
          }
        }
      },
      "span": {
        "properties": {
          "action": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "composite": {
            "properties": {
              "compression_strategy": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "count": {
                "type": "long"
              },
              "sum": {
                "properties": {
                  "us": {
                    "type": "long"
                  }
                }
              }
            }
          },
          "db": {
            "properties": {
              "instance": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "rows_affected": {
                "type": "long"
              },
              "statement": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "type": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "user": {
                "properties": {
                  "name": {
                    "type": "keyword",
                    "fields": {
                      "text": {
                        "type": "match_only_text"
                      }
                    }
                  }
                }
              }
            }
          },
          "destination": {
            "properties": {
              "service": {
                "properties": {
                  "name": {
                    "type": "keyword",
                    "fields": {
                      "text": {
                        "type": "match_only_text"
                      }
                    }
                  },
                  "resource": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "type": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              }
            }
          },
          "duration": {
            "properties": {
              "us": {
                "type": "long"
              }
            }
          },
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "kind": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "links": {
            "properties": {
              "span": {
                "properties": {
                  "id": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              },
              "trace": {
                "properties": {
                  "id": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              }
            }
          },
          "message": {
            "properties": {
              "queue": {
                "properties": {
                  "name": {
                    "type": "keyword",
                    "fields": {
                      "text": {
                        "type": "match_only_text"
                      }
                    }
                  }
                }
              }
            }
          },
          "name": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "representative_count": {
            "type": "scaled_float",
            "index": false,
            "scaling_factor": 1000
          },
          "stacktrace": {
            "type": "object",
            "dynamic": "false"
          },
          "subtype": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "sync": {
            "type": "boolean"
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "timestamp": {
        "properties": {
          "us": {
            "type": "long"
          }
        }
      },
      "trace": {
        "properties": {
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "transaction": {
        "properties": {
          "custom": {
            "type": "object",
            "dynamic": "false"
          },
          "duration": {
            "properties": {
              "us": {
                "type": "long"
              }
            }
          },
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "message": {
            "properties": {
              "age": {
                "properties": {
                  "ms": {
                    "type": "long"
                  }
                }
              },
              "headers": {
                "properties": {
                  "Contenttype": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Elastic-Apm-Traceparent": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Event_type": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Id": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Jms_sqsmessagetype": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Jmsexpiration": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Jmsmessageid": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Jmstimestamp": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Jmsxdeliverycount": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Jmsxgroupid": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Routing_notification_type": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Timestamp": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Traceparent": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Tracestate": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "Work_resource_type": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              },
              "queue": {
                "properties": {
                  "name": {
                    "type": "keyword",
                    "fields": {
                      "text": {
                        "type": "match_only_text"
                      }
                    }
                  }
                }
              }
            }
          },
          "name": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "profiler_stack_trace_ids": {
            "type": "counted_keyword"
          },
          "representative_count": {
            "type": "scaled_float",
            "index": false,
            "scaling_factor": 1000
          },
          "result": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "sampled": {
            "type": "boolean"
          },
          "span_count": {
            "properties": {
              "dropped": {
                "type": "long"
              },
              "started": {
                "type": "long"
              }
            }
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "url": {
        "properties": {
          "domain": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "full": {
            "type": "wildcard",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "original": {
            "type": "wildcard",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "path": {
            "type": "wildcard"
          },
          "port": {
            "type": "long"
          },
          "query": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "scheme": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "user": {
        "properties": {
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "name": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          }
        }
      },
      "user_agent": {
        "properties": {
          "device": {
            "properties": {
              "name": {
                "type": "keyword",
                "fields": {
                  "text": {
                    "type": "match_only_text"
                  }
                }
              }
            }
          },
          "name": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "original": {
            "type": "keyword",
            "fields": {
              "text": {
                "type": "match_only_text"
              }
            }
          },
          "os": {
            "properties": {
              "full": {
                "type": "keyword",
                "fields": {
                  "text": {
                    "type": "match_only_text"
                  }
                }
              },
              "name": {
                "type": "keyword",
                "fields": {
                  "text": {
                    "type": "match_only_text"
                  }
                }
              },
              "version": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      }
    }
  }
}
  1. Go to Index management and click on the created index
  2. Click on the Mappings tab. It shows an error:

Image

Error in console:

Uncaught TypeError: Cannot read properties of undefined (reading 'label')
    at use_state_listener.tsx:30:1
    at Array.map (<anonymous>)
    at use_state_listener.tsx:28:1
    at mountMemo (react-dom.development.js:15846:1)
    at Object.useMemo (react-dom.development.js:16219:1)
    at useMemo (react.development.js:1532:1)
    at useMappingsStateListener (use_state_listener.tsx:26:1)
    at DetailsPageMappingsContent (details_page_mappings_content.tsx:155:1)
    at renderWithHooks (react-dom.development.js:14985:1)
    at mountIndeterminateComponent (react-dom.development.js:17811:1)

This error seems to come from this line:

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:

"profiler_stack_trace_ids": {
    "type": "counted_keyword"
},

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.

@ElenaStoeva ElenaStoeva added bug Fixes for quality problems that affect the customer experience Feature:Mappings Editor Index mappings editor UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Oct 24, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@ElenaStoeva ElenaStoeva self-assigned this Oct 29, 2024
@ElenaStoeva
Copy link
Contributor Author

ElenaStoeva commented Oct 29, 2024

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.

@alisonelizabeth
Copy link
Contributor

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

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.

@ElenaStoeva
Copy link
Contributor Author

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:

Image

In fact, an unrecognized type can also be added through the UI, using the "Other" type option.

Image

kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Oct 30, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Mappings Editor Index mappings editor UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
3 participants