{
  "id": "api/grpc-unavailable-dns-resolution-failed",
  "signature": "gRPC error: UNAVAILABLE: DNS resolution failed for service",
  "signature_zh": "gRPC错误：UNAVAILABLE：服务DNS解析失败",
  "regex": "gRPC\\s*error\\s*[:]?\\s*UNAVAILABLE\\s*[:]?\\s*DNS\\s*resolution\\s*\\w+",
  "domain": "api",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "gRPC client cannot resolve the service hostname via DNS, often due to transient network issues, misconfigured DNS, or service discovery outages.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC客户端无法通过DNS解析服务主机名，通常是由于临时网络问题、DNS配置错误或服务发现中断。",
  "versions": [
    {
      "version": "gRPC v1.58.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Envoy 1.28.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.28",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CoreDNS 1.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restarting the client application without fixing DNS configuration or network connectivity",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Assuming the service is down when it's actually a DNS resolution failure on the client side",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Changing gRPC load balancing policy (e.g., round_robin to pick_first) which doesn't affect DNS resolution",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify DNS resolution: `nslookup service.example.com` or `dig service.example.com`. If fails, check /etc/resolv.conf and DNS server health.",
      "success_rate": 0.9,
      "how": "Verify DNS resolution: `nslookup service.example.com` or `dig service.example.com`. If fails, check /etc/resolv.conf and DNS server health.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Configure gRPC with custom DNS resolver: In Go, use `google.golang.org/grpc/resolver` and set `grpc.WithDefaultServiceConfig('{\"loadBalancingConfig\": [{\"round_robin\":{}}]}')`",
      "success_rate": 0.8,
      "how": "Configure gRPC with custom DNS resolver: In Go, use `google.golang.org/grpc/resolver` and set `grpc.WithDefaultServiceConfig('{\"loadBalancingConfig\": [{\"round_robin\":{}}]}')`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add retry logic with exponential backoff for transient DNS failures: in gRPC-Go, use `grpc.WithUnaryInterceptor(grpc_retry.UnaryClientInterceptor())`",
      "success_rate": 0.85,
      "how": "Add retry logic with exponential backoff for transient DNS failures: in gRPC-Go, use `grpc.WithUnaryInterceptor(grpc_retry.UnaryClientInterceptor())`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "验证DNS解析：`nslookup service.example.com` 或 `dig service.example.com`。如果失败，检查/etc/resolv.conf和DNS服务器健康状态。",
    "为gRPC配置自定义DNS解析器：在Go中，使用`google.golang.org/grpc/resolver`并设置`grpc.WithDefaultServiceConfig('{\"loadBalancingConfig\": [{\"round_robin\":{}}]}')`",
    "添加带指数退避的重试逻辑以处理临时DNS故障：在gRPC-Go中，使用`grpc.WithUnaryInterceptor(grpc_retry.UnaryClientInterceptor())`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/error/",
  "official_doc_section": null,
  "error_code": "UNAVAILABLE",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.78,
  "resolvable": "partial",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}