{"record":{"id":"fef3a197c1e9878c","repo":"influxdata/influxdb","slug":"line-protocol-parse-failed","errorCode":null,"errorMessage":"line protocol parse failed: {}","messagePattern":"line protocol parse failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/write_buffer/mod.rs","lineNumber":70,"sourceCode":"use iox_time::{Time, TimeProvider};\nuse metric::Registry;\nuse metrics::WriteMetrics;\nuse object_store::{ObjectMeta, ObjectStore, path::Path as ObjPath};\nuse observability_deps::tracing::{debug, info, trace, warn};\nuse parquet_file::storage::DataSourceExecInput;\nuse queryable_buffer::QueryableBufferArgs;\nuse schema::Schema;\nuse std::{\n    borrow::Borrow,\n    num::{NonZeroU64, NonZeroUsize},\n    sync::Arc,\n    time::Duration,\n};\nuse thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum Error {\n    #[error(\"line protocol parse failed: {}\", .0.error_message)]\n    ParseError(WriteLineError),\n\n    #[error(\"incoming write was empty\")]\n    EmptyWrite,\n\n    #[error(\"column type mismatch for column {name}: existing: {existing:?}, new: {new:?}\")]\n    ColumnTypeMismatch {\n        name: String,\n        existing: ColumnType,\n        new: ColumnType,\n    },\n\n    #[error(\"catalog update error: {0}\")]\n    CatalogUpdateError(#[from] CatalogError),\n\n    #[error(\"error from persister: {0}\")]\n    PersisterError(#[from] PersisterError),\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/write_buffer/mod.rs#L52-L88","documentation":"write_buffer::Error::ParseError indicates that one or more lines of InfluxDB line protocol failed to parse before entering the write buffer. The wrapped WriteLineError carries the precise error_message (line number and reason). The batch was rejected; no data from the failing line was written.","triggerScenarios":"Calling the write buffer's write_lp / line-protocol ingestion API with malformed input: bad timestamps, unquoted commas/equals in field keys or tags, invalid field values, or wrong measurement syntax.","commonSituations":"Telegraf or custom agents emitting unescaped special characters (spaces, commas, =) in tags; clients sending integer fields without the 'i' suffix; mixing up line protocol v1 conventions; truncated payloads from flaky HTTP clients; timestamps in wrong unit or out of range.","solutions":["Read the wrapped WriteLineError's error_message for the exact line number and parse reason.","Fix the offending line: quote values containing commas/spaces/equals and suffix integer fields with 'i'.","Validate payloads client-side with a line protocol parser/linter before sending.","Ensure timestamps are valid 64-bit nanosecond Unix timestamps (or correct precision with the precision parameter)."],"exampleFix":"// before\nlet lp = \"m,tag=a value=hello 123\"; // value not parseable as float\nbuffer.write_lp(lp).await?;\n// after\nlet lp = \"m,tag=a value=\\\"hello\\\" 123\"; // quote string fields\nbuffer.write_lp(lp).await?;","handlingStrategy":"validation","validationCode":"// Rust: validate line protocol client-side before writing\nfn is_valid_lp(batch: &str) -> bool {\n  batch.lines().all(|l| {\n    let l = l.trim();\n    !l.is_empty()\n      && l.split_once(' ').map_or(false, |(m, _)| !m.is_empty())\n      // additionally run influxdb3 line-protocol parser in dry-run\n  })\n}","typeGuard":"fn as_parse_error(e: &write_buffer::Error) -> Option<&WriteLineError> {\n  match e { write_buffer::Error::ParseError(wle) => Some(wle), _ => None }\n}","tryCatchPattern":"match buffer.write_lp(payload).await {\n  Err(write_buffer::Error::ParseError(wle)) => {\n    log::warn!(\"rejected LP at {}: {}\", wle.line_number(), wle.error_message);\n    dead_letter(payload_line(wle.line_number()));\n  }\n  Err(e) => return Err(e),\n  Ok(r) => r,\n}","preventionTips":["Escape commas, equals, and spaces in tag/field keys and quote string values.","Suffix integer fields with 'i' and validate timestamps as ns or set precision explicitly.","Run a line-protocol linter in the producer pipeline before shipping batches.","Keep the failing line and message from WriteLineError in structured logs for triage."],"tags":["line-protocol","parse","influxdb3","write"],"backgroundTag":"invalid-argument-format","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"}