influxdata/influxdb · error · Error::NoInput
No input from stdin detected, no string was passed in, and…
Error message
No input from stdin detected, no string was passed in, and no file path was given
What it means
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`.
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
Example fix
// before influxdb3 query // after influxdb3 query "SELECT * FROM weather"
Defensive patterns
Strategy: validation
Validate before calling
// shell guard
QUERY="${1:-}"
if [[ -z "$QUERY" && ! -p /dev/stdin && -z "$FILE" ]]; then
echo "supply a query string, stdin, or --file" >&2; exit 1
fi Prevention
- Quote the SQL positional argument
- Use --file for long queries stored on disk
- Check piped stdin is non-empty in scripts
When it happens
Trigger: Running `influxdb3 query` with no positional SQL argument, an empty/closed stdin, and no `--file <path>` given.
Common situations: 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.
Understand the failure class
Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.
Related errors
- No input from stdin detected, no string was passed in, and…
- is not a valid data type, values are int64, uint64…
- Cannot parse object store config
- cannot write parquet to a terminal, use `--output
- client error
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/147484a9076e9f2a.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_commands/src/query.rs:30
use crate::common::Format;
use super::common::InfluxDb3Config;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
Client(#[from] influxdb3_client::Error),
#[error("invlid UTF8 received from server: {0}")]
Utf8(#[from] Utf8Error),
#[error("io error: {0}")]
Io(#[from] io::Error),
#[error("cannot write parquet to a terminal, use `--output <file>` or pipe the output")]
NoOutputFileForParquet,
#[error(
"No input from stdin detected, no string was passed in, and no file \
path was given"
)]
NoInput,
}
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Parser)]
#[clap(visible_alias = "q")]
pub struct Config {
/// Common InfluxDB 3 server config
#[clap(flatten)]
influxdb3_config: InfluxDb3Config,
/// Override host URL for query operations
#[clap(long = "query-host", env = "INFLUXDB3_QUERY_HOST_URL")]
query_host_url: Option<Url>,View on GitHub (pinned to 06200ef96b)