{
  "id": "go/protobuf-required-field-not-set",
  "signature": "proto: required field \"user.id\" not set",
  "signature_zh": "proto：必填字段 \"user.id\" 未设置",
  "regex": "proto:\\ required\\ field\\ \"user\\.id\"\\ not\\ set",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A proto2 message has a required field that was not populated before marshaling. proto3 removed required, but proto2 (and some migrated schemas) still enforce it.",
  "root_cause_type": "generic",
  "root_cause_zh": "proto2 消息中存在必填字段，在序列化前未赋值。proto3 已移除 required，但 proto2（及部分迁移中的 schema）仍强制校验。",
  "versions": [
    {
      "version": "google.golang.org/protobuf v1.26+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Produces wire bytes that downstream strict servers reject; the field is still missing.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "proto2 distinguishes 'unset' from 'zero'; setting zero still counts as set only if you explicitly assign it — but semantically you're sending bad data.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Populate required fields before marshal, or migrate the schema to proto3:\nmsg := &pb.User{Id: userID, Name: name}\nif err := proto.Marshal(msg); err != nil { return err }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "If the field truly is optional, edit the .proto to remove `required` and regenerate:\n// user.proto\nmessage User { optional string id = 1; }",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}