{
  "id": "grpc/grpc-web-failed-to-fetch",
  "signature": "INTERNAL: grpc-web: Failed to fetch",
  "signature_zh": "内部错误: grpc-web: 获取失败",
  "regex": "INTERNAL: grpc-web: Failed to fetch",
  "domain": "grpc",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "Browser CORS policy or network failure prevents gRPC-Web requests from reaching the Envoy proxy or gRPC server.",
  "root_cause_type": "generic",
  "root_cause_zh": "浏览器 CORS 策略或网络故障阻止 gRPC-Web 请求到达 Envoy 代理或 gRPC 服务器。",
  "versions": [
    {
      "version": "grpc-web 1.4.2",
      "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": "grpc-go 1.62.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "protobuf 25.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Bypasses security but breaks in production and on other browsers; not a real fix.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is not timeout-related; it's a pre-request fetch failure, so timeout changes have no effect.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Configure Envoy CORS filter to allow the origin, methods, and headers. Example Envoy config snippet:\n  http_filters:\n  - name: envoy.filters.http.cors\n    typed_config:\n      \"@type\": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors\n      allow_origin_string_match:\n      - prefix: \"https://myapp.example.com\"\n      allow_methods: \"POST, OPTIONS\"\n      allow_headers: \"content-type, x-grpc-web, x-user-agent\"\n      max_age: \"86400\"\n  Then restart Envoy.",
      "success_rate": 0.85,
      "how": "Configure Envoy CORS filter to allow the origin, methods, and headers. Example Envoy config snippet:\n  http_filters:\n  - name: envoy.filters.http.cors\n    typed_config:\n      \"@type\": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors\n      allow_origin_string_match:\n      - prefix: \"https://myapp.example.com\"\n      allow_methods: \"POST, OPTIONS\"\n      allow_headers: \"content-type, x-grpc-web, x-user-agent\"\n      max_age: \"86400\"\n  Then restart Envoy.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure the gRPC-Web client uses the correct URL (e.g., http://localhost:8080 instead of https://localhost:8080 if TLS is not set up) and that the Envoy proxy is running and reachable. Verify with curl: curl -v http://localhost:8080/your.service/Method",
      "success_rate": 0.95,
      "how": "Ensure the gRPC-Web client uses the correct URL (e.g., http://localhost:8080 instead of https://localhost:8080 if TLS is not set up) and that the Envoy proxy is running and reachable. Verify with curl: curl -v http://localhost:8080/your.service/Method",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Configure Envoy CORS filter to allow the origin, methods, and headers. Example Envoy config snippet:\n  http_filters:\n  - name: envoy.filters.http.cors\n    typed_config:\n      \"@type\": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors\n      allow_origin_string_match:\n      - prefix: \"https://myapp.example.com\"\n      allow_methods: \"POST, OPTIONS\"\n      allow_headers: \"content-type, x-grpc-web, x-user-agent\"\n      max_age: \"86400\"\n  Then restart Envoy.",
    "Ensure the gRPC-Web client uses the correct URL (e.g., http://localhost:8080 instead of https://localhost:8080 if TLS is not set up) and that the Envoy proxy is running and reachable. Verify with curl: curl -v http://localhost:8080/your.service/Method"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://github.com/grpc/grpc-web/blob/master/doc/cors.md",
  "official_doc_section": null,
  "error_code": "GRPC_WEB_FETCH_FAILED",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}