{
  "id": "go/grpc-internal-error-marshalling",
  "signature": "rpc error: code = Internal desc = grpc: error while marshaling: proto: syntax error (line 1:1): unexpected token",
  "signature_zh": "rpc错误：代码=内部错误 描述=grpc：编组时出错：proto：语法错误（第1行第1列）：意外的令牌",
  "regex": "rpc\\ error:\\ code\\ =\\ Internal\\ desc\\ =\\ grpc:\\ error\\ while\\ marshaling:\\ proto:\\ syntax\\ error\\ \\(line\\ 1:1\\):\\ unexpected\\ token",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The protobuf message being sent is malformed or does not match the schema, causing marshalling failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "发送的protobuf消息格式错误或与模式不匹配，导致编组失败。",
  "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 retry the same request.",
      "why_fails": "The same malformed message will cause the same error repeatedly.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Change the protobuf field types without updating the definition.",
      "why_fails": "Field types are fixed in the .proto file; changing them manually leads to incompatibility.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Validate the protobuf message before sending.",
      "success_rate": 0.85,
      "how": "req := &pb.MyRequest{Name: \"test\"}\nif err := req.Validate(); err != nil {\n    log.Fatalf(\"invalid request: %v\", err)\n}\n// Use proto.Marshal to check if marshalling works\nif _, err := proto.Marshal(req); err != nil {\n    log.Fatalf(\"marshal error: %v\", err)\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure the protobuf library version matches the generated code.",
      "success_rate": 0.8,
      "how": "Check go.mod for google.golang.org/protobuf version and run 'go mod tidy' to sync.",
      "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": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}