# WebSocket close code 1005: Abnormal Closure (no status code received)

- **ID:** `api/websocket-close-code-1005-abnormal-close-no-status`
- **Domain:** api
- **Category:** network_error
- **Error Code:** `1005`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The WebSocket connection was terminated without sending a close frame, often due to network interruption, server crash, or proxy timeout.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| RFC 6455 | active | — | — |
| WebSocket API (W3C) | active | — | — |
| Node.js ws v8 | active | — | — |
| Python websockets v12 | active | — | — |

## Workarounds

1. **Implement automatic reconnection with exponential backoff in the client: `function reconnect() { setTimeout(() => new WebSocket(url), 1000 * Math.pow(2, attempts)); }`** (85% success)
   ```
   Implement automatic reconnection with exponential backoff in the client: `function reconnect() { setTimeout(() => new WebSocket(url), 1000 * Math.pow(2, attempts)); }`
   ```
2. **Check server and proxy logs for timeout or resource exhaustion; increase WebSocket timeout settings (e.g., `nginx proxy_read_timeout 3600s`).** (80% success)
   ```
   Check server and proxy logs for timeout or resource exhaustion; increase WebSocket timeout settings (e.g., `nginx proxy_read_timeout 3600s`).
   ```

## Dead Ends

- **** — The issue may be transient network flapping, not server failure. (70% fail)
- **** — The connection is already closed; data will be lost. (100% fail)
