{"record":{"id":"6ad8265c43c98163","repo":"influxdata/influxdb","slug":"no-input-from-stdin-detected-no-string-was-passed-in-and-no-6ad826","errorCode":null,"errorMessage":"No input from stdin detected, no string was passed in, and no file path was given","messagePattern":"No input from stdin detected, no string was passed in, and no file path was given","errorType":"error_code","errorClass":"Error::NoInput","httpStatus":null,"severity":"error","filePath":"influxdb3_commands/src/write.rs","lineNumber":38,"sourceCode":"use url::Url;\n\n/// Default per-request body size cap. Matches the server's default\n/// `--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","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_commands/src/write.rs#L20-L56","documentation":"The influxdb3 `write` command's `NoInput` variant fires when no line protocol input was provided: no positional string, no data on stdin, and no `--file` path. The command cannot write anything to the server without input.","triggerScenarios":"Running `influxdb3 write --database <db>` with no LP string argument, empty stdin, and no `--file` flag.","commonSituations":"Empty piped file (`cat empty.lp | influxdb3 write ...`); forgotten quoted LP string; misordered arguments so the LP string is consumed as a flag value.","solutions":["Pass the line protocol as the final quoted argument: `influxdb3 write --database my-db 'm,t=a v=1'`","Pipe LP via stdin: `cat data.lp | influxdb3 write --database my-db`","Use `--file <path>` with a non-empty line protocol file"],"exampleFix":"// before\ninfluxdb3 write --database my-db\n// after\ninfluxdb3 write --database my-db 'cpu,host=a usage=0.5'","handlingStrategy":"validation","validationCode":"// shell guard\nif [[ -z \"$LP_STRING\" && ! -s \"${LP_FILE:-}\" && ! -p /dev/stdin ]]; then\n  echo \"no line protocol input: pass string, --file, or stdin\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default to an explicit --file in automated scripts","Verify piped files are non-empty","Keep LP strings quoted"],"tags":["cli","stdin","line-protocol","missing-input"],"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"}