nikivdev/code · error

no queries provided

Error message

no queries provided

What it means

run_index loads queries from the --query option and --queries sources via load_index_queries; if the resulting list is empty there is nothing to search, so it bails with this message. Unlike 627, configuration succeeded — only the query set is empty.

Source

Thrown at src/install.rs:131

}

fn is_existing_destination_error(err: &anyhow::Error) -> bool {
    err.to_string().contains("already exists")
}

fn looks_like_remote_external_cli_id(name: &str) -> bool {
    name.starts_with("cli_") || name.starts_with("cli:")
}

pub fn run_index(opts: InstallIndexOpts) -> Result<()> {
    let flox_bin = resolve_flox_bin()?;
    let Some(config) = typesense_config_with_overrides(&opts) else {
        bail!("Typesense config missing (set FLOW_TYPESENSE_URL or pass --url)");
    };

    let queries = load_index_queries(opts.query, opts.queries)?;
    if queries.is_empty() {
        bail!("no queries provided");
    }

    let mut all_entries: HashMap<String, FloxDisplayEntry> = HashMap::new();
    for query in queries {
        let results = flox_search_with_aliases(&flox_bin, &query)?;
        for entry in results {
            all_entries.entry(entry.pkg_path.clone()).or_insert(entry);
        }
    }

    if all_entries.is_empty() {
        println!("No results to index.");
        return Ok(());
    }

    if opts.dry_run {
        println!("Would index {} packages into Typesense.", all_entries.len());
        return Ok(());

View on GitHub (pinned to a747e741ae)

Solutions

  1. Pass at least one search term, e.g. --query "rust cli".
  2. If using --queries, point it at a non-empty queries file and confirm its contents load.
  3. Check that the queries file path is correct relative to your working directory.
  4. Remove comment-only/blank lines issue by adding real query lines to the file.

Example fix

// before
f install index
// after
f install index --query "rust cli"
Defensive patterns

Strategy: validation

Validate before calling

let queries: Vec<String> = collect_queries(opts); // from --query / --queries
if queries.is_empty() {
    eprintln!("nothing to index: pass --query \"term\" or a non-empty --queries file");
}

Try / catch

match run_index(opts) {
    Err(e) if e.to_string() == "no queries provided" => {
        eprintln!("add at least one --query or point --queries at a non-empty file");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Running the index subcommand with neither --query nor --queries, or where the queries file/source provided to load_index_queries yields zero queries (e.g. empty file).

Common situations: User forgets to pass --query/--queries; a queries file exists but is empty or only contains comments; wrong path passed so load_index_queries silently returns an empty list.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/28439e7d1dcab146. Report an issue: GitHub.