{"record":{"id":"1ef0b5c7b52931a2","repo":"influxdata/influxdb","slug":"no-line-protocol-string-provided","errorCode":null,"errorMessage":"no line protocol string provided","messagePattern":"no line protocol string provided","errorType":"error_code","errorClass":"Error::NoLine","httpStatus":null,"severity":"error","filePath":"influxdb3_commands/src/write.rs","lineNumber":41,"sourceCode":"/// `--max-http-request-size` so a `write` command piped from a generator\n/// that produces a stream larger than 10 MiB still succeeds out of the box.\nconst DEFAULT_MAX_REQUEST_SIZE: usize = 10 * 1024 * 1024;\n\n/// Size of each blocking `read()` from the input source (file / stdin).\nconst READ_SIZE: usize = 4 * 1024 * 1024;\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(transparent)]\n    Client(#[from] influxdb3_client::Error),\n\n    #[error(\"error reading file: {0}\")]\n    Io(#[from] io::Error),\n\n    #[error(\"No input from stdin detected, no string was passed in, and no file path was given\")]\n    NoInput,\n\n    #[error(\"no line protocol string provided\")]\n    NoLine,\n\n    #[error(\n        \"ensure that a single protocol line string is provided as the final \\\n        argument, enclosed in quotes\"\n    )]\n    MoreThanOne,\n}\n\npub type Result<T> = std::result::Result<T, Error>;\n\n#[derive(Debug, Parser)]\n#[clap(visible_alias = \"w\", trailing_var_arg = true)]\npub struct Config {\n    /// Common InfluxDB 3 server config\n    #[clap(flatten)]\n    influxdb3_config: InfluxDb3Config,\n","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_commands/src/write.rs#L23-L59","documentation":"The influxdb3 `write` command's `NoLine` variant is thrown when no line protocol string was supplied as the positional argument (e.g., the user passed only flags or an empty string). Distinct from NoInput in that it specifically flags the missing LP line string.","triggerScenarios":"Calling write with an empty string argument or omitting the LP positional while flags like `--database` are present and no stdin/file fallback provided input.","commonSituations":"Shell variable holding LP is empty (`influxdb3 write --database db \"$LP\"` with LP unset); scripting wrappers dropping the final argument.","solutions":["Ensure a non-empty quoted line protocol string is passed as the final argument","Check the shell variable containing LP is set and non-empty","Fall back to `--file` or stdin when the string is not available"],"exampleFix":"// before\nLP=\"\"; influxdb3 write --database my-db \"$LP\"\n// after\nLP='cpu,host=a usage=0.5'; influxdb3 write --database my-db \"$LP\"","handlingStrategy":"validation","validationCode":"// shell guard\nif [[ -z \"${1:-}\" ]]; then\n  echo \"line protocol string is required as final argument\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check shell variables for emptiness before interpolation","Always pass the LP string as the last, quoted argument","Prefer --file/stdin for programmatic writes"],"tags":["cli","line-protocol","missing-argument"],"backgroundTag":"missing-cli-argument","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"}