{"record":{"id":"b04e66918951a19a","repo":"influxdata/influxdb","slug":"transparent-singletenantextracterror","errorCode":null,"errorMessage":"<transparent: SingleTenantExtractError>","messagePattern":"<transparent: SingleTenantExtractError>","errorType":"exception","errorClass":"WriteParseError","httpStatus":null,"severity":"error","filePath":"core/iox_http/src/write/params.rs","lineNumber":49,"sourceCode":"            Self::Nanosecond => 1,\n        }\n    }\n}\n\n#[derive(Debug)]\n/// Standardized DML operation parameters\npub struct WriteParams {\n    pub namespace: NamespaceName<'static>,\n    pub precision: Precision,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum WriteParseError {\n    #[error(\"not implemented\")]\n    NotImplemented,\n\n    /// An error parsing a single-tenant HTTP request.\n    #[error(transparent)]\n    SingleTenantError(#[from] SingleTenantExtractError),\n\n    /// An error parsing a multi-tenant HTTP request.\n    #[error(transparent)]\n    MultiTenantError(#[from] MultiTenantExtractError),\n}\n\nimpl From<&WriteParseError> for hyper::StatusCode {\n    fn from(value: &WriteParseError) -> Self {\n        match value {\n            WriteParseError::NotImplemented => Self::METHOD_NOT_ALLOWED,\n            WriteParseError::SingleTenantError(e) => Self::from(e),\n            WriteParseError::MultiTenantError(e) => Self::from(e),\n        }\n    }\n}\n\n/// A [`WriteRequestUnifier`] abstraction returns a unified [`WriteParams`]","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_http/src/write/params.rs#L31-L67","documentation":"This is a transparent wrapper in iox_http's WriteParseError for SingleTenantExtractError. It occurs when parsing a single-tenant HTTP write request fails; the inner extraction error's message is displayed unchanged. It aggregates failures like invalid line protocol or bad write parameters in single-tenant mode.","triggerScenarios":"POSTing a write request to the single-tenant endpoint where request extraction (body decoding, line protocol parsing, params) fails.","commonSituations":"Malformed line protocol payloads; wrong Content-Type/encoding headers; legacy single-tenant clients sending unexpected fields.","solutions":["Read the inner SingleTenantExtractError message for the concrete failure.","Validate line protocol payload and Content-Type before sending.","Ensure the client targets the correct single-tenant endpoint contract.","Test the payload with a known-good writer to isolate the malformed part."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust: sanity-check single-tenant write request before sending\nfn single_tenant_write_ok(body: &str, content_type: &str) -> bool {\n    content_type.starts_with(\"text/plain\") // line protocol\n        && body.lines().all(|l| !l.trim().is_empty())\n}","typeGuard":"fn is_single_tenant_err(e: &WriteParseError) -> bool {\n    matches!(e, WriteParseError::SingleTenantError(_))\n}","tryCatchPattern":null,"preventionTips":["Send well-formed line protocol with the correct Content-Type","Test payloads with a known-good writer to isolate malformed lines","Keep client/server write API versions aligned"],"tags":["http","write","parse","single-tenant"],"backgroundTag":"schema-validation-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"}