{
  "id": "elasticsearch/role-mapping-parse-error",
  "signature": "ElasticsearchSecurityException: failed to parse role-mapping [my_mapping] - unknown field [invalid_field]",
  "signature_zh": "ElasticsearchSecurityException：解析角色映射[my_mapping]失败 - 未知字段[invalid_field]",
  "regex": "failed to parse role-mapping \\[.*\\] - unknown field \\[.*\\]",
  "domain": "elasticsearch",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A role mapping definition contains an unsupported field name, causing parsing to fail.",
  "root_cause_type": "generic",
  "root_cause_zh": "角色映射定义包含不支持的字段名，导致解析失败。",
  "versions": [
    {
      "version": "elasticsearch 7.16.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "elasticsearch 8.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "elasticsearch 8.14.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "May reintroduce the same invalid field if the user is unaware of the correct schema.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Null values for unknown fields still trigger parse errors because the field itself is not recognized.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The field is invalid regardless of version; upgrading does not change the schema.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Remove the unknown field from the role mapping definition. For example, if the mapping had 'invalid_field', delete it: DELETE _security/role_mapping/my_mapping then PUT _security/role_mapping/my_mapping with valid fields like 'roles', 'rules', 'enabled'.",
      "success_rate": 0.9,
      "how": "Remove the unknown field from the role mapping definition. For example, if the mapping had 'invalid_field', delete it: DELETE _security/role_mapping/my_mapping then PUT _security/role_mapping/my_mapping with valid fields like 'roles', 'rules', 'enabled'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the official documentation for supported fields and correct the mapping accordingly.",
      "success_rate": 0.95,
      "how": "Check the official documentation for supported fields and correct the mapping accordingly.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the Get Role Mapping API to inspect the current mapping and compare with the expected schema: GET _security/role_mapping/my_mapping",
      "success_rate": 0.85,
      "how": "Use the Get Role Mapping API to inspect the current mapping and compare with the expected schema: GET _security/role_mapping/my_mapping",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "从角色映射定义中移除未知字段。例如，如果映射包含'invalid_field'，删除它：DELETE _security/role_mapping/my_mapping 然后 PUT _security/role_mapping/my_mapping 使用有效字段如'roles'、'rules'、'enabled'。",
    "查阅官方文档了解支持的字段，并相应修正映射。",
    "使用获取角色映射API检查当前映射并与预期模式对比：GET _security/role_mapping/my_mapping"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2025-02-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}