{
  "id": "go/grpc-permission-denied-auth-token",
  "signature": "rpc error: code = PermissionDenied desc = invalid auth token",
  "signature_zh": "rpc 错误：代码 = PermissionDenied 描述 = 无效的身份验证令牌",
  "regex": "rpc\\ error:\\ code\\ =\\ PermissionDenied\\ desc\\ =\\ invalid\\ auth\\ token",
  "domain": "go",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "The authentication token provided in the gRPC metadata is invalid or expired.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC 元数据中提供的身份验证令牌无效或已过期。",
  "versions": [
    {
      "version": "1.56.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.57.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Continuing to use the same expired token.",
      "why_fails": "Token is still invalid.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using a static test token in production.",
      "why_fails": "Security risk and may not be valid in production.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing the token from metadata.",
      "why_fails": "Server requires authentication.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "token, err := refreshToken(); if err != nil { log.Fatal(err) }; md := metadata.Pairs(\"authorization\", \"Bearer \"+token)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "interceptor := func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { token := getValidToken(); ctx = metadata.AppendToOutgoingContext(ctx, \"authorization\", \"Bearer \"+token); return invoker(ctx, method, req, reply, cc, opts...) }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "if token.Expiry.Before(time.Now()) { token, err = refreshToken() }",
      "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-07-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}