{
  "id": "grpc/grpc-protobuf-unknown-field",
  "signature": "INTERNAL: grpc: protobuf unknown field encountered: field number 12345",
  "signature_zh": "内部错误: grpc: 遇到 protobuf 未知字段: 字段编号 12345",
  "regex": "INTERNAL: grpc: protobuf unknown field encountered: field number \\d+",
  "domain": "grpc",
  "category": "encoding_error",
  "subcategory": null,
  "root_cause": "Server received a protobuf message containing a field number that is not defined in the .proto schema, often due to version mismatch between client and server.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器收到包含 .proto 模式中未定义的字段编号的 protobuf 消息，通常是由于客户端和服务器之间的版本不匹配。",
  "versions": [
    {
      "version": "protobuf 25.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "grpc-go 1.62.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "grpc-java 1.60.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "buf 1.28.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This hides the symptom but does not fix the root cause; data loss may occur if important fields are ignored.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Unknown field handling is a proto3 feature; older versions may still reject or silently drop fields, leading to data corruption.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Synchronize the .proto files between client and server. Run:\n  buf breaking --against .git\n  to detect breaking changes. Regenerate code for both sides:\n  protoc --go_out=. --go-grpc_out=. *.proto\n  Or use Buf to manage versioning:\n  buf generate --template buf.gen.yaml",
      "success_rate": 0.9,
      "how": "Synchronize the .proto files between client and server. Run:\n  buf breaking --against .git\n  to detect breaking changes. Regenerate code for both sides:\n  protoc --go_out=. --go-grpc_out=. *.proto\n  Or use Buf to manage versioning:\n  buf generate --template buf.gen.yaml",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the unknown field is intentional (e.g., forward compatibility), use protojson or custom parsing to explicitly handle unknown fields. In gRPC-Go, set:\n  import \"google.golang.org/protobuf/encoding/protojson\"\n  opts := protojson.MarshalOptions{AllowPartial: true}\n  But prefer updating the schema to include the field.",
      "success_rate": 0.8,
      "how": "If the unknown field is intentional (e.g., forward compatibility), use protojson or custom parsing to explicitly handle unknown fields. In gRPC-Go, set:\n  import \"google.golang.org/protobuf/encoding/protojson\"\n  opts := protojson.MarshalOptions{AllowPartial: true}\n  But prefer updating the schema to include the field.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Synchronize the .proto files between client and server. Run:\n  buf breaking --against .git\n  to detect breaking changes. Regenerate code for both sides:\n  protoc --go_out=. --go-grpc_out=. *.proto\n  Or use Buf to manage versioning:\n  buf generate --template buf.gen.yaml",
    "If the unknown field is intentional (e.g., forward compatibility), use protojson or custom parsing to explicitly handle unknown fields. In gRPC-Go, set:\n  import \"google.golang.org/protobuf/encoding/protojson\"\n  opts := protojson.MarshalOptions{AllowPartial: true}\n  But prefer updating the schema to include the field."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://protobuf.dev/programming-guides/field_presence/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-02-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}