influxdata/influxdb · error · Error

partial write of line protocol occurred

Error message

partial write of line protocol occurred

What it means

Raised when a buffered write succeeded only partially: some line protocol points in the request were written, but at least one failed. The variant carries the BufferedWriteRequest so the caller can inspect which lines were accepted and retry the rest. It signals a partial-failure state, not a total rejection.

Solutions

  1. Inspect the BufferedWriteRequest payload to identify which lines failed.
  2. Split the batch: keep accepted lines, fix or drop the invalid line(s), and resend only the remainder.
  3. Validate line protocol syntax and field types client-side before sending batches.
  4. Ensure timestamps are not out of order relative to the database ordering constraints.

Example fix

// before
// send 1000 lines in one request, one is malformed -> partial write
curl -X POST 'http://localhost:8181/api/v3/write?db=mydb' --data-binary @batch.lp
// after
// validate/split the batch; retry only failed lines
wc -l batch.lp && influxdb3 write --file batch.lp --dry-run 2>/dev/null || split-and-retry
Defensive patterns

Strategy: try-catch

Validate before calling

// validate line protocol lines client-side before batching
const valid = lines.every(l => /^\S+(\s\S+)*\s\d+$/.test(l.trim()));

Try / catch

try { await writeBatch(lines); } catch (e) { if (e.message.startsWith('partial write')) { const { accepted, failed } = splitAccepted(e.data); await writeBatch(fixed(failed)); } else throw e; }

Prevention

When it happens

Trigger: POSTing a batch of line protocol to /write or /api/v3/write where one or more lines are invalid (bad syntax, schema conflict, out-of-order timestamps) while others commit successfully.

Common situations: Bulk-loading mixed-quality historical data; a schema/type conflict in one line among thousands of valid ones; a single malformed line from a upstream generator in an otherwise good batch.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/a9ca5a5ac069e005. Report an issue: GitHub.

Appendix: source

Thrown at influxdb3_server/src/http.rs:326

    SerdeJson(#[from] serde_json::Error),

    // Influxdb3 Write
    #[error("serde json error: {0}")]
    Influxdb3Write(#[from] influxdb3_write::Error),

    #[error("datafusion error: {0}")]
    Datafusion(#[from] DataFusionError),

    #[error("io error: {0}")]
    Io(#[from] std::io::Error),

    #[error("query error: {0}")]
    Query(#[from] QueryExecutorError),

    #[error(transparent)]
    DbName(#[from] ValidateDbNameError),

    #[error("partial write of line protocol occurred")]
    PartialLpWrite(BufferedWriteRequest),

    #[error("error in InfluxQL statement: {0}")]
    InfluxqlRewrite(#[from] rewrite::Error),

    #[error("must provide only one InfluxQl statement per query")]
    InfluxqlSingleStatement,

    #[error("must specify a 'db' parameter, or provide the database in the InfluxQL query")]
    InfluxqlNoDatabase,

    #[error(
        "provided a database in both the parameters ({param_db}) and \
        query string ({query_db}) that do not match, if providing a query \
        that specifies the database, you can omit the 'database' parameter \
        from your request"
    )]
    InfluxqlDatabaseMismatch { param_db: String, query_db: String },

View on GitHub (pinned to 06200ef96b)