{"record":{"id":"a9ca5a5ac069e005","repo":"influxdata/influxdb","slug":"partial-write-of-line-protocol-occurred","errorCode":null,"errorMessage":"partial write of line protocol occurred","messagePattern":"partial write of line protocol occurred","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":326,"sourceCode":"    SerdeJson(#[from] serde_json::Error),\n\n    // Influxdb3 Write\n    #[error(\"serde json error: {0}\")]\n    Influxdb3Write(#[from] influxdb3_write::Error),\n\n    #[error(\"datafusion error: {0}\")]\n    Datafusion(#[from] DataFusionError),\n\n    #[error(\"io error: {0}\")]\n    Io(#[from] std::io::Error),\n\n    #[error(\"query error: {0}\")]\n    Query(#[from] QueryExecutorError),\n\n    #[error(transparent)]\n    DbName(#[from] ValidateDbNameError),\n\n    #[error(\"partial write of line protocol occurred\")]\n    PartialLpWrite(BufferedWriteRequest),\n\n    #[error(\"error in InfluxQL statement: {0}\")]\n    InfluxqlRewrite(#[from] rewrite::Error),\n\n    #[error(\"must provide only one InfluxQl statement per query\")]\n    InfluxqlSingleStatement,\n\n    #[error(\"must specify a 'db' parameter, or provide the database in the InfluxQL query\")]\n    InfluxqlNoDatabase,\n\n    #[error(\n        \"provided a database in both the parameters ({param_db}) and \\\n        query string ({query_db}) that do not match, if providing a query \\\n        that specifies the database, you can omit the 'database' parameter \\\n        from your request\"\n    )]\n    InfluxqlDatabaseMismatch { param_db: String, query_db: String },","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L308-L344","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the BufferedWriteRequest payload to identify which lines failed.","Split the batch: keep accepted lines, fix or drop the invalid line(s), and resend only the remainder.","Validate line protocol syntax and field types client-side before sending batches.","Ensure timestamps are not out of order relative to the database ordering constraints."],"exampleFix":"// before\n// send 1000 lines in one request, one is malformed -> partial write\ncurl -X POST 'http://localhost:8181/api/v3/write?db=mydb' --data-binary @batch.lp\n// after\n// validate/split the batch; retry only failed lines\nwc -l batch.lp && influxdb3 write --file batch.lp --dry-run 2>/dev/null || split-and-retry","handlingStrategy":"try-catch","validationCode":"// validate line protocol lines client-side before batching\nconst valid = lines.every(l => /^\\S+(\\s\\S+)*\\s\\d+$/.test(l.trim()));","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Validate every line's syntax and field types before batching","Keep timestamps monotonic within a batch","Split very large batches so failures are small","Track schema conflicts (field type changes) in your ingest pipeline"],"tags":["write","line-protocol","partial-write"],"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"}