{"record":{"id":"147484a9076e9f2a","repo":"influxdata/influxdb","slug":"no-input-from-stdin-detected-no-string-was-passed-in-and-no","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/query.rs","lineNumber":30,"sourceCode":"\nuse crate::common::Format;\n\nuse super::common::InfluxDb3Config;\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(transparent)]\n    Client(#[from] influxdb3_client::Error),\n\n    #[error(\"invlid UTF8 received from server: {0}\")]\n    Utf8(#[from] Utf8Error),\n\n    #[error(\"io error: {0}\")]\n    Io(#[from] io::Error),\n\n    #[error(\"cannot write parquet to a terminal, use `--output <file>` or pipe the output\")]\n    NoOutputFileForParquet,\n    #[error(\n        \"No input from stdin detected, no string was passed in,  and no file \\\n        path was given\"\n    )]\n    NoInput,\n}\n\npub type Result<T> = std::result::Result<T, Error>;\n\n#[derive(Debug, Parser)]\n#[clap(visible_alias = \"q\")]\npub struct Config {\n    /// Common InfluxDB 3 server config\n    #[clap(flatten)]\n    influxdb3_config: InfluxDb3Config,\n\n    /// Override host URL for query operations\n    #[clap(long = \"query-host\", env = \"INFLUXDB3_QUERY_HOST_URL\")]\n    query_host_url: Option<Url>,","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_commands/src/query.rs#L12-L48","documentation":"The influxdb3 `query` command requires a query either as a positional string argument, via stdin, or via a file path (`--file`). When none of these supply a query string, this error is thrown from the query.rs Error enum variant `NoInput`.","triggerScenarios":"Running `influxdb3 query` with no positional SQL argument, an empty/closed stdin, and no `--file <path>` given.","commonSituations":"Forgetting to quote the SQL string so the shell passes nothing; piping from an empty stream (`echo -n '' | influxdb3 query`); typo-ing the `--file` flag so no input source is detected.","solutions":["Pass the SQL query as a quoted positional argument: `influxdb3 query \"SELECT ...\"`","Pipe the query via stdin: `cat query.sql | influxdb3 query`","Supply `--file <path>` pointing to a file containing the query"],"exampleFix":"// before\ninfluxdb3 query\n// after\ninfluxdb3 query \"SELECT * FROM weather\"","handlingStrategy":"validation","validationCode":"// shell guard\nQUERY=\"${1:-}\"\nif [[ -z \"$QUERY\" && ! -p /dev/stdin && -z \"$FILE\" ]]; then\n  echo \"supply a query string, stdin, or --file\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quote the SQL positional argument","Use --file for long queries stored on disk","Check piped stdin is non-empty in scripts"],"tags":["cli","stdin","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"}