{
  "id": "api/websocket-close-code-1006-abnormal-closure",
  "signature": "WebSocket close code 1006: Abnormal Closure",
  "signature_zh": "WebSocket 关闭代码 1006：异常关闭",
  "regex": "WebSocket.*close.*1006|websocket.*abnormal.*closure|Error.*1006",
  "domain": "api",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The WebSocket connection was closed unexpectedly without a normal close frame, often due to network issues, proxy timeouts, or server crash.",
  "root_cause_type": "generic",
  "root_cause_zh": "WebSocket 连接在未发送正常关闭帧的情况下意外关闭，通常由于网络问题、代理超时或服务器崩溃。",
  "versions": [
    {
      "version": "WebSocket RFC 6455",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ws library v8.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Node.js v20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Reconnecting without delay may hit the same network issue or server load, causing repeated 1006 closures.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is often network-related, not a code logic bug; rewriting may not address the root cause.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The library is rarely the cause; the underlying TCP connection is the issue.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement exponential backoff reconnection with jitter.",
      "success_rate": 0.85,
      "how": "Implement exponential backoff reconnection with jitter.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a health check endpoint and only reconnect if server is alive.",
      "success_rate": 0.8,
      "how": "Add a health check endpoint and only reconnect if server is alive.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Implement exponential backoff reconnection with jitter.",
    "Add a health check endpoint and only reconnect if server is alive."
  ],
  "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.85,
  "fix_success_rate": 0.7,
  "resolvable": "partial",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}