{"record":{"id":"e8d0b1df22f6b8a9","repo":"influxdata/influxdb","slug":"ensure-that-a-single-protocol-line-string-is-provided-as-the","errorCode":null,"errorMessage":"ensure that a single protocol line string is provided as the final argument, enclosed in quotes","messagePattern":"ensure that a single protocol line string is provided as the final argument, enclosed in quotes","errorType":"error_code","errorClass":"Error::MoreThanOne","httpStatus":null,"severity":"error","filePath":"influxdb3_commands/src/write.rs","lineNumber":44,"sourceCode":"\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\n    /// Override host URL for write operations\n    #[clap(long = \"write-host\", env = \"INFLUXDB3_WRITE_HOST_URL\")]\n    write_host_url: Option<Url>,","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_commands/src/write.rs#L26-L62","documentation":"The influxdb3 `write` command's `MoreThanOne` variant fires when more than one positional argument is given. The command accepts exactly one line protocol string as the final argument, so extra arguments are ambiguous.","triggerScenarios":"Running `influxdb3 write --database db 'm1 v=1' 'm2 v=2'` or an unquoted LP string whose spaces split it into multiple shell words.","commonSituations":"Forgetting quotes around line protocol containing spaces; passing multiple LP lines expecting batching (must use a file or stdin instead).","solutions":["Enclose the whole LP string in single quotes so it is one argument","Move multiple lines into a file and use `--file <path>`","Pipe multiple lines via stdin"],"exampleFix":"// before\ninfluxdb3 write --database my-db cpu,host=a usage=0.5\n// after\ninfluxdb3 write --database my-db 'cpu,host=a usage=0.5'","handlingStrategy":"validation","validationCode":"// shell guard\nif (( $# > 1 )); then\n  echo \"pass exactly one quoted line protocol string; use --file for multiple lines\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always single-quote LP strings containing spaces","Batch multiple LP lines via --file or stdin","Quote variables: \"$LP\" not $LP"],"tags":["cli","arguments","line-protocol","quoting"],"backgroundTag":"invalid-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"}