{"record":{"id":"28439e7d1dcab146","repo":"nikivdev/code","slug":"no-queries-provided","errorCode":null,"errorMessage":"no queries provided","messagePattern":"no queries provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/install.rs","lineNumber":131,"sourceCode":"}\n\nfn is_existing_destination_error(err: &anyhow::Error) -> bool {\n    err.to_string().contains(\"already exists\")\n}\n\nfn looks_like_remote_external_cli_id(name: &str) -> bool {\n    name.starts_with(\"cli_\") || name.starts_with(\"cli:\")\n}\n\npub fn run_index(opts: InstallIndexOpts) -> Result<()> {\n    let flox_bin = resolve_flox_bin()?;\n    let Some(config) = typesense_config_with_overrides(&opts) else {\n        bail!(\"Typesense config missing (set FLOW_TYPESENSE_URL or pass --url)\");\n    };\n\n    let queries = load_index_queries(opts.query, opts.queries)?;\n    if queries.is_empty() {\n        bail!(\"no queries provided\");\n    }\n\n    let mut all_entries: HashMap<String, FloxDisplayEntry> = HashMap::new();\n    for query in queries {\n        let results = flox_search_with_aliases(&flox_bin, &query)?;\n        for entry in results {\n            all_entries.entry(entry.pkg_path.clone()).or_insert(entry);\n        }\n    }\n\n    if all_entries.is_empty() {\n        println!(\"No results to index.\");\n        return Ok(());\n    }\n\n    if opts.dry_run {\n        println!(\"Would index {} packages into Typesense.\", all_entries.len());\n        return Ok(());","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/install.rs#L113-L149","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Pass at least one search term, e.g. --query \"rust cli\".","If using --queries, point it at a non-empty queries file and confirm its contents load.","Check that the queries file path is correct relative to your working directory.","Remove comment-only/blank lines issue by adding real query lines to the file."],"exampleFix":"// before\nf install index\n// after\nf install index --query \"rust cli\"","handlingStrategy":"validation","validationCode":"let queries: Vec<String> = collect_queries(opts); // from --query / --queries\nif queries.is_empty() {\n    eprintln!(\"nothing to index: pass --query \\\"term\\\" or a non-empty --queries file\");\n}","typeGuard":null,"tryCatchPattern":"match run_index(opts) {\n    Err(e) if e.to_string() == \"no queries provided\" => {\n        eprintln!(\"add at least one --query or point --queries at a non-empty file\");\n    }\n    r => r?,\n}","preventionTips":["Always pass --query or a populated --queries file","Verify the queries file is non-empty and contains real query lines, not just comments","Check the file path is correct relative to the working directory"],"tags":["input-validation","cli","empty-input"],"backgroundTag":"missing-required-argument","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}