{
  "id": "nginx/upstream-connection-reset-by-peer",
  "signature": "upstream connection reset by peer while reading response header from upstream",
  "signature_zh": "在从上游读取响应头时，上游连接被对端重置",
  "regex": "upstream connection reset by peer while reading response header from upstream",
  "domain": "nginx",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The upstream server forcibly closes the TCP connection (RST packet) before sending a complete response, often due to application crash or timeout.",
  "root_cause_type": "generic",
  "root_cause_zh": "上游服务器在发送完整响应之前强制关闭TCP连接（RST包），通常由应用程序崩溃或超时引起。",
  "versions": [
    {
      "version": "nginx 1.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.20.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.22.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx 1.25.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Connection timeout only affects initial handshake, not response reading; RST occurs after connection is established.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "HTTP version change may affect keepalive but doesn't prevent RST from upstream.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This disables keepalive but upstream may still send RST if it crashes.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check upstream application logs for crashes or timeouts; fix the application to handle requests gracefully",
      "success_rate": 0.85,
      "how": "Check upstream application logs for crashes or timeouts; fix the application to handle requests gracefully",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add retry logic with proxy_next_upstream: proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;",
      "success_rate": 0.8,
      "how": "Add retry logic with proxy_next_upstream: proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase upstream keepalive settings to reduce connection churn: keepalive 32;",
      "success_rate": 0.6,
      "how": "Increase upstream keepalive settings to reduce connection churn: keepalive 32;",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "检查上游应用程序日志中的崩溃或超时；修复应用程序以优雅处理请求",
    "使用proxy_next_upstream添加重试逻辑：proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;",
    "增加上游keepalive设置以减少连接变更：keepalive 32;"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.82,
  "resolvable": "partial",
  "first_seen": "2024-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}