{
  "id": "go/grpc-unknown-protobuf-field",
  "signature": "error: unknown field \"new_field\" in google.protobuf.Struct",
  "signature_zh": "错误：google.protobuf.Struct 中存在未知字段 \"new_field\"",
  "regex": "error:\\ unknown\\ field\\ \"new_field\"\\ in\\ google\\.protobuf\\.Struct",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The client or server is sending a protobuf message with a field that was added in a newer version of the .proto file, but the receiving side is using an older compiled version that doesn't know about it.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端或服务器发送的 protobuf 消息包含较新版本 .proto 文件中新增的字段，但接收方使用的是旧编译版本，无法识别该字段。",
  "versions": [
    {
      "version": "1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Ignore the error and hope the message is processed successfully",
      "why_fails": "The error is returned by the protobuf unmarshaller, so the message is discarded entirely, and the RPC fails.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually parse the JSON representation instead of using protobuf",
      "why_fails": "This bypasses the type safety and can lead to data corruption or security issues, and still won't resolve the unknown field error.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Regenerate the protobuf code with the latest .proto file",
      "success_rate": 0.95,
      "how": "protoc --go_out=. --go-grpc_out=. your.proto",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable protobuf unknown field preservation to avoid errors",
      "success_rate": 0.85,
      "how": "import \"google.golang.org/protobuf/proto\"\n// Use proto.UnmarshalOptions{DiscardUnknown: true} when unmarshaling",
      "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-02-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}