{
  "id": "communication/websocket-1006-abnormal-closure",
  "signature": "WebSocket close frame received with status code 1006 (abnormal closure)",
  "signature_zh": "WebSocket收到状态码为1006的关闭帧（异常关闭）",
  "regex": "status code 1006|AbnormalClosure|websocket.*1006",
  "domain": "communication",
  "category": "connection_error",
  "subcategory": null,
  "root_cause": "WebSocket connection terminated unexpectedly without a close frame, typically due to network failure, proxy timeout, or server crash.",
  "root_cause_type": "generic",
  "root_cause_zh": "WebSocket连接在没有关闭帧的情况下意外终止，通常由网络故障、代理超时或服务器崩溃引起。",
  "versions": [
    {
      "version": "RFC 6455",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "WebSocket++ 0.8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ws 8.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Node.js 20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase the WebSocket ping/pong interval on the client",
      "why_fails": "1006 is not a timeout error; it's an abnormal closure where no close frame is sent. Ping/pong intervals only help with idle timeouts, not sudden disconnections",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable SSL/TLS on the WebSocket connection",
      "why_fails": "1006 can occur over both ws:// and wss://; disabling encryption does not prevent network-level drops",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Switch from WebSocket to long polling as a workaround",
      "why_fails": "Long polling introduces different failure modes and does not fix the root cause of unstable WebSocket connections",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement automatic reconnection with exponential backoff on the client. When a 1006 closure is detected, wait 1s, 2s, 4s, etc., before reconnecting. Log the event to diagnose network stability.",
      "success_rate": 0.8,
      "how": "Implement automatic reconnection with exponential backoff on the client. When a 1006 closure is detected, wait 1s, 2s, 4s, etc., before reconnecting. Log the event to diagnose network stability.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check proxy and load balancer settings for WebSocket timeout. On NGINX, ensure proxy_read_timeout is set high (e.g., 3600s) and proxy_http_version is 1.1 with Connection upgrade.",
      "success_rate": 0.75,
      "how": "Check proxy and load balancer settings for WebSocket timeout. On NGINX, ensure proxy_read_timeout is set high (e.g., 3600s) and proxy_http_version is 1.1 with Connection upgrade.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Implement automatic reconnection with exponential backoff on the client. When a 1006 closure is detected, wait 1s, 2s, 4s, etc., before reconnecting. Log the event to diagnose network stability.",
    "Check proxy and load balancer settings for WebSocket timeout. On NGINX, ensure proxy_read_timeout is set high (e.g., 3600s) and proxy_http_version is 1.1 with Connection upgrade."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1",
  "official_doc_section": null,
  "error_code": "1006",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.7,
  "resolvable": "partial",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}