{
  "id": "communication/websocket-message-too-large-fragmentation",
  "signature": "WebSocket frame exceeds maximum size: 65535 bytes",
  "signature_zh": "WebSocket帧超出最大大小：65535字节",
  "regex": "WebSocket frame exceeds maximum size|frame too large|max frame length exceeded",
  "domain": "communication",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "A WebSocket frame payload exceeds the 16-bit length limit (65535 bytes) when the application sends data without enabling fragmentation or using extension frames, violating RFC 6455 section 5.2.",
  "root_cause_type": "generic",
  "root_cause_zh": "WebSocket帧的有效载荷超过16位长度限制（65535字节），原因是应用程序在未启用分片或使用扩展帧的情况下发送数据，违反了RFC 6455第5.2节。",
  "versions": [
    {
      "version": "Node.js ws 8.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python websockets 12.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go gorilla/websocket 1.5.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java Tyrus 2.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Nginx 1.25.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase the frame size limit in the WebSocket library configuration",
      "why_fails": "The RFC mandates a maximum frame payload of 2^16-1 bytes for unfragmented frames; increasing the limit may cause protocol-level errors or disconnection.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Switch to HTTP/2 streaming instead of WebSocket",
      "why_fails": "HTTP/2 streaming has different semantics and may not support bidirectional real-time communication; it requires significant application redesign.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Compress the data before sending to reduce payload size",
      "why_fails": "Compression may not be feasible for binary data or real-time streams, and it adds CPU overhead; it also doesn't address the root cause of not using fragmentation.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Enable WebSocket fragmentation in the sender: for Python websockets, use 'await websocket.send(message, fragment_size=16384)' to automatically split large messages into multiple frames.",
      "success_rate": 0.9,
      "how": "Enable WebSocket fragmentation in the sender: for Python websockets, use 'await websocket.send(message, fragment_size=16384)' to automatically split large messages into multiple frames.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement application-level chunking: split the payload into chunks of < 65535 bytes on the client and reassemble on the server using a sequence ID.",
      "success_rate": 0.85,
      "how": "Implement application-level chunking: split the payload into chunks of < 65535 bytes on the client and reassemble on the server using a sequence ID.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use WebSocket extensions like 'permessage-deflate' to compress data, reducing payload size below the limit.",
      "success_rate": 0.75,
      "how": "Use WebSocket extensions like 'permessage-deflate' to compress data, reducing payload size below the limit.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Enable WebSocket fragmentation in the sender: for Python websockets, use 'await websocket.send(message, fragment_size=16384)' to automatically split large messages into multiple frames.",
    "Implement application-level chunking: split the payload into chunks of < 65535 bytes on the client and reassemble on the server using a sequence ID.",
    "Use WebSocket extensions like 'permessage-deflate' to compress data, reducing payload size below the limit."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://datatracker.ietf.org/doc/html/rfc6455#section-5.2",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2023-11-07",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}