{
  "id": "go/grpc-out-of-range-index",
  "signature": "rpc error: code = OutOfRange desc = index out of bounds: 10 > 5",
  "signature_zh": "rpc 错误：代码 = OutOfRange 描述 = 索引超出界限：10 > 5",
  "regex": "rpc\\ error:\\ code\\ =\\ OutOfRange\\ desc\\ =\\ index\\ out\\ of\\ bounds:\\ 10\\ >\\ 5",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A request attempted to access an element beyond the valid range, e.g., pagination offset too high.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求尝试访问超出有效范围的元素，例如，分页偏移量过高。",
  "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": "Retrying with the same out-of-range index.",
      "why_fails": "Same error will occur.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Trying negative values.",
      "why_fails": "Still out of range.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Blaming server for incorrect range validation.",
      "why_fails": "Client should respect limits.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "if offset > totalItems { offset = totalItems }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "req := &pb.ListRequest{Offset: offset, Limit: limit}; if offset+limit > max { return error }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "resp, err := client.List(ctx, req); if resp.TotalCount > 0 { offset = min(offset, resp.TotalCount-1) }",
      "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": "2025-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}