{
  "id": "go/grpc-protobuf-enum-out-of-range",
  "signature": "error: proto: field \"status\" has invalid enum value: 99",
  "signature_zh": "错误：proto：字段\"status\"具有无效的枚举值：99",
  "regex": "error:\\ proto:\\ field\\ \"status\"\\ has\\ invalid\\ enum\\ value:\\ 99",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The protobuf message contains an enum field with a numeric value not defined in the .proto file, often due to version drift.",
  "root_cause_type": "generic",
  "root_cause_zh": "protobuf消息包含一个枚举字段，其数值未在.proto文件中定义，通常是由于版本漂移。",
  "versions": [
    {
      "version": "1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Ignore the error and continue processing.",
      "why_fails": "Unmarshal will fail completely, no partial data.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Cast the value to int and treat as unknown.",
      "why_fails": "Protobuf enums are strict; unknown values cause rejection.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the missing enum value to the .proto file and regenerate.",
      "success_rate": 0.9,
      "how": "enum Status { UNKNOWN = 0; ACTIVE = 1; INACTIVE = 2; CUSTOM = 99; }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use proto.EnumValueMap to map unknown values to a default.",
      "success_rate": 0.6,
      "how": "import \"google.golang.org/protobuf/types/known/anypb\"\n// Not directly supported; requires custom unmarshaler",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-05-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}