{
  "id": "go/grpc-unavailable-connection-refused",
  "signature": "rpc error: code = Unavailable desc = connection error: desc = \"transport: error while dialing: dial tcp 127.0.0.1:8080: connect: connection refused\"",
  "signature_zh": "rpc错误：代码=不可用 描述=连接错误：描述=\"传输：拨号时出错：拨号tcp 127.0.0.1:8080：连接被拒绝\"",
  "regex": "rpc\\ error:\\ code\\ =\\ Unavailable\\ desc\\ =\\ connection\\ error:\\ desc\\ =\\ \"transport:\\ error\\ while\\ dialing:\\ dial\\ tcp\\ 127\\.0\\.0\\.1:8080:\\ connect:\\ connection\\ refused\"",
  "domain": "go",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "gRPC client attempts to connect to a server that is not running or the port is incorrect.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC客户端尝试连接到未运行或端口错误的服务器。",
  "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": "Retry the connection with exponential backoff without checking server status.",
      "why_fails": "If the server is down, retries will keep failing until the server is up. This wastes resources and delays detection.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase the dial timeout in client configuration.",
      "why_fails": "A longer timeout does not fix the fundamental issue of server unavailability; it just delays the error.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the gRPC server is running and accessible at the configured address.",
      "success_rate": 0.95,
      "how": "Check server health by verifying the process is active and listening on the expected port. Use netstat or lsof to confirm.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement a health check and retry logic with circuit breaker.",
      "success_rate": 0.85,
      "how": "conn, err := grpc.Dial(\"localhost:8080\", grpc.WithInsecure(), grpc.WithBlock(), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(1024*1024*4)))\nif err != nil {\n    log.Fatalf(\"did not connect: %v\", err)\n}\ndefer conn.Close()",
      "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-01-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}