{
  "id": "go/grpc-already-exists",
  "signature": "rpc error: code = AlreadyExists desc = duplicate registration of service pb.OrderService",
  "signature_zh": "rpc 错误：代码 = AlreadyExists 描述 = 服务 pb.OrderService 重复注册",
  "regex": "rpc\\ error:\\ code\\ =\\ AlreadyExists\\ desc\\ =\\ duplicate\\ registration\\ of\\ service\\ pb\\.OrderService",
  "domain": "go",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "RegisterOrderServiceServer was called twice on the same grpc.Server, or two server instances share a registry. gRPC panics on duplicate service registration.",
  "root_cause_type": "generic",
  "root_cause_zh": "在同一个 grpc.Server 上两次调用了 RegisterOrderServiceServer，或两个服务端实例共享了注册表。gRPC 在重复注册服务时会 panic。",
  "versions": [
    {
      "version": "google.golang.org/grpc v1.46+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Recovering hides the bug; the second registration still fails and the server state is inconsistent.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Multiple servers on one listener conflict; only one can bind the port, and requests route unpredictably.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "s := grpc.NewServer()\npb.RegisterOrderServiceServer(s, svc)\n// do not register again elsewhere",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "var once sync.Once\nonce.Do(func() { pb.RegisterOrderServiceServer(s, svc) })",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}