{"record":{"id":"686e36a847455b00","repo":"influxdata/influxdb","slug":"client-disconnected","errorCode":null,"errorMessage":"client disconnected","messagePattern":"client disconnected","errorType":"http","errorClass":"Error::ClientHangup","httpStatus":null,"severity":"warning","filePath":"influxdb3_server/src/http.rs","lineNumber":220,"sourceCode":"\n    /// The `Content-Encoding` header is invalid and cannot be read.\n    #[error(\"invalid content-encoding header: {0}\")]\n    NonUtf8ContentEncodingHeader(hyper::header::ToStrError),\n\n    /// The `Content-Type` header is invalid and cannot be read.\n    #[error(\"invalid content-type header: {0}\")]\n    NonUtf8ContentTypeHeader(hyper::header::ToStrError),\n\n    /// The specified `Content-Encoding` is not acceptable.\n    #[error(\"unacceptable content-encoding: {0}\")]\n    InvalidContentEncoding(String),\n\n    /// The specified `Content-Type` is not acceptable.\n    #[error(\"unacceptable content-type, expected: {expected}\")]\n    InvalidContentType { expected: mime::Mime },\n\n    /// The client disconnected.\n    #[error(\"client disconnected\")]\n    ClientHangup(Box<dyn std::error::Error + Send + Sync>),\n\n    /// The client sent a request body that exceeds the configured maximum.\n    #[error(\"max request size ({0} bytes) exceeded\")]\n    RequestSizeExceeded(usize),\n\n    /// Decoding a gzip-compressed stream of data failed.\n    #[error(\"error decoding gzip stream: {0}\")]\n    InvalidGzip(std::io::Error),\n\n    #[error(\"invalid mime type ({0})\")]\n    InvalidMimeType(String),\n\n    /// DatabaseName validation error.\n    #[error(\"error validating database name: {0}\")]\n    InvalidDatabaseName(#[from] DatabaseNameError),\n\n    /// Failure to decode the provided line protocol.","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L202-L238","documentation":"`Error::ClientHangup` is raised when the client's TCP connection drops while the server is reading the request body or writing the response; the source underlying cause is boxed into the error payload. It indicates the peer disconnected mid-request, so no HTTP status can be delivered.","triggerScenarios":"The client closes the connection or times out while a large body upload is in flight, load balancers/proxies with short idle timeouts kill the connection, or the client aborts the request (fetch AbortController, curl --max-time).","commonSituations":"Long-running writes over flaky networks, idle-timeout mismatches behind nginx/ALB, aggressive client-side timeouts on slow bulk inserts, and k8s probes or retries that abandon requests.","solutions":["Check client-side logs for aborted requests and align client timeouts to exceed the upload duration","Increase proxy/load-balancer idle and read timeouts (e.g. nginx proxy_read_timeout) for write endpoints","Implement client retries with backoff for idempotent writes and resume/re-send the payload","Verify network stability between client and server (no intermediate NAT/proxy dropping idle connections)"],"exampleFix":"// before\ncurl --max-time 2 -X POST $URL --data-binary @big.lp\n// after\ncurl --max-time 120 -X POST $URL --data-binary @big.lp","handlingStrategy":"retry","validationCode":"const client = axios.create({ timeout: 120000 }); // ensure timeout > expected upload time\nkeepAlive agent with generous idle timeout","typeGuard":null,"tryCatchPattern":"try { await send(); } catch (e) { if (isClientHangup(e)) { await retryWithBackoff(send, 3); } else throw e; }","preventionTips":["Set client timeouts well above worst-case upload duration","Increase LB/proxy idle and read timeouts for write endpoints","Enable keep-alive and retries with backoff in the HTTP client","Avoid aborting in-flight bulk writes; monitor network stability"],"tags":["http","network","disconnect"],"backgroundTag":"broken-pipe","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}