{"record":{"id":"100e326235165666","repo":"influxdata/influxdb","slug":"write-buffer-error-0-lib","errorCode":null,"errorMessage":"write buffer error: {0}","messagePattern":"write buffer error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/lib.rs","lineNumber":51,"sourceCode":"};\nuse influxdb3_id::{DbId, ParquetFileId, SerdeVecMap, TableId};\nuse influxdb3_types::DatabaseName;\npub use influxdb3_types::write::Precision;\nuse influxdb3_wal::{SnapshotSequenceNumber, Wal, WalFileSequenceNumber};\nuse iox_query::QueryChunk;\nuse iox_time::Time;\nuse observability_deps::tracing::debug;\nuse schema::TIME_COLUMN_NAME;\nuse serde::{Deserialize, Serialize};\nuse std::{fmt::Debug, sync::Arc};\nuse thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum Error {\n    #[error(\"object store path error: {0}\")]\n    ObjStorePath(#[from] object_store::path::Error),\n\n    #[error(\"write buffer error: {0}\")]\n    WriteBuffer(#[from] write_buffer::Error),\n\n    #[error(\"persister error: {0}\")]\n    Persister(#[from] persister::PersisterError),\n\n    #[error(\"queries not supported in compactor only mode\")]\n    CompactorOnly,\n\n    #[error(\"unexpected: {0:?}\")]\n    Anyhow(#[from] anyhow::Error),\n}\n\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\npub trait WriteBuffer: Bufferer + ChunkContainer + DistinctCacheManager + LastCacheManager {}\n\n/// The buffer is for buffering data in memory and in the wal before it is persisted as parquet files in storage.\n#[async_trait]","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/lib.rs#L33-L69","documentation":"The WriteBuffer variant wraps write_buffer::Error, the core error type of the InfluxDB 3 write buffer (the in-memory/persisted buffer accepting line-protocol writes). Any failure during ingesting, validating, buffering, or persisting written data is re-exposed through this variant. Check the wrapped inner error for the real cause.","triggerScenarios":"Calls to WriteBuffer::write_lp / persist operations returning write_buffer::Error: invalid line protocol, schema conflicts (field type changes), database/table creation failures, or internal buffer errors during ingest.","commonSituations":"Clients sending malformed line protocol; a table's field types conflict with an existing schema (e.g. sending a string where an integer exists); writing to a deleted database; compaction/write-buffer threads failing in server logs.","solutions":["Read the wrapped write_buffer::Error via the Display/#[from] source to get the specific cause","Fix the line protocol or field types in client payloads to match the existing schema","Recreate the database/table or adjust schema if a hard schema conflict occurred","Check server logs for buffer persistence failures (object store availability, disk space)"],"exampleFix":"// before\nline_protocol: \"cpu,host=a usage=\" // empty field value, parse error inside write buffer\n// after\nline_protocol: \"cpu,host=a usage=0.5\" // valid field value","handlingStrategy":"try-catch","validationCode":"// validate line protocol before writing\nif !line.contains('=') || line.split(',').next().map_or(true, |m| m.is_empty()) {\n    return Err(\"invalid line protocol point\");\n}","typeGuard":"fn is_write_buffer_error(e: &influxdb3_write::Error) -> Option<&write_buffer::Error> {\n    match e { influxdb3_write::Error::WriteBuffer(w) => Some(w), _ => None }\n}","tryCatchPattern":"match buffer.write_lp(namespace, lp, accept_partial, ingest_time) {\n    Err(influxdb3_write::Error::WriteBuffer(inner)) => {\n        log::warn!(\"write rejected by buffer: {}\", inner);\n        // inspect inner for parse vs schema vs persistence cause\n    }\n    r => r?,\n}","preventionTips":["Validate line protocol client-side before sending","Register schemas ahead of time and keep field types stable","Avoid writing to databases/tables deleted concurrently","Monitor write-buffer persistence errors in server logs"],"tags":["rust","write-buffer","ingest"],"backgroundTag":"database-write-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"}