{"record":{"id":"7bc83d287c571ef1","repo":"influxdata/influxdb","slug":"failed-to-parse-plaintext-response","errorCode":null,"errorMessage":"failed to parse plaintext response: {}","messagePattern":"failed to parse plaintext response: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_client/src/lib.rs","lineNumber":53,"sourceCode":"    RequestSerialization(#[source] serde_json::Error),\n\n    #[error(\n        \"provided parameter ('{name}') could not be converted \\\n        to a statment parameter\"\n    )]\n    ConvertQueryParam {\n        name: String,\n        #[source]\n        source: iox_query_params::Error,\n    },\n\n    #[error(\"invalid UTF8 in response: {0}\")]\n    InvalidUtf8(#[from] FromUtf8Error),\n\n    #[error(\"failed to parse JSON response: {}\", reqwest_description(.0))]\n    Json(#[source] reqwest::Error),\n\n    #[error(\"failed to parse plaintext response: {}\", reqwest_description(.0))]\n    Text(#[source] reqwest::Error),\n\n    #[error(\"server responded with error [{code}]: {message}\")]\n    ApiError {\n        code: StatusCode,\n        message: String,\n        /// Machine-readable error code from JSON error responses, if present.\n        error_code: Option<String>,\n    },\n\n    #[error(\"failed to send {method} {url} request: {}\", reqwest_description(.source))]\n    RequestSend {\n        method: Method,\n        url: String,\n        #[source]\n        source: reqwest::Error,\n    },\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_client/src/lib.rs#L35-L71","documentation":"Error::Text in influxdb3_client::Error, raised when the client expects a plaintext (non-JSON) response body and decoding/processing it via reqwest fails. The reqwest::Error is the #[source]; reqwest_description renders reqwest's detail into the message. Typically the body could not be read as text at the transport layer rather than being bad plaintext content.","triggerScenarios":"Calling endpoints whose response is read as text when the underlying reqwest body read errors out (connection reset mid-body, decompression failure, timeout during body read).","commonSituations":"Server closes the connection while streaming a text response; gzip/br decompression mismatch between client features and server encoding; idle timeouts cutting off a slow response.","solutions":["Inspect the source chain to identify the transport cause (reset vs timeout vs decompression)","Retry the request; this is usually transient connection-level failure","Align Content-Encoding support (enable the matching reqwest compression feature) with the server's encoding","Increase the client timeout if large/slow text responses are being cut off","Check server/proxy logs for connection resets around the failing request"],"exampleFix":"// before\nlet txt = client.some_text_endpoint().await?;\n// after\nlet txt = match client.some_text_endpoint().await {\n    Ok(t) => t,\n    Err(e @ influxdb3_client::Error::Text(_)) => {\n        eprintln!(\"text response failed: {e:#}\");\n        return Err(e); // or retry\n    }\n};","handlingStrategy":"retry","validationCode":"// pre-flight: confirm server reachable and encoding supported\n// curl -sH 'Accept-Encoding: identity' {base_url}/health","typeGuard":"fn is_text_parse_error(e: &influxdb3_client::Error) -> bool {\n    matches!(e, influxdb3_client::Error::Text(_))\n}","tryCatchPattern":"match result {\n    Err(influxdb3_client::Error::Text(src)) => {\n        if is_retryable(&src) { retry_with_backoff(); }\n        else { return Err(src.into()); }\n    }\n    other => other?,\n}","preventionTips":["Use larger client timeouts for endpoints returning large text bodies","Keep reqwest compression features consistent with server Content-Encoding","Avoid reading text responses over flaky links without a retry wrapper"],"tags":["http","plaintext","influxdb3","client"],"backgroundTag":"http-request-failed","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"}