{"record":{"id":"a4701e1f470ec663","repo":"AprilNEA/OpenLogi","slug":"no-addressable-physical-device-candidate-was-found","errorCode":null,"errorMessage":"no addressable physical device candidate was found","messagePattern":"no addressable physical device candidate was found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/target_selection.rs","lineNumber":15,"sourceCode":"//! Strict fixture target selection with privacy-safe diagnostics.\n\nuse std::fmt::Write as _;\n\nuse anyhow::{Result, anyhow, bail};\nuse openlogi_core::hid::DeviceRoute;\n\npub(super) trait FixtureTarget: Clone {\n    fn route(&self) -> &DeviceRoute;\n    fn display_name(&self) -> &str;\n}\n\npub(super) fn select_target<T: FixtureTarget>(candidates: &[T], query: Option<&str>) -> Result<T> {\n    if candidates.is_empty() {\n        bail!(\"no addressable physical device candidate was found\");\n    }\n\n    let mut matches = match query {\n        Some(query) => candidates\n            .iter()\n            .filter(|candidate| {\n                candidate.display_name().eq_ignore_ascii_case(query)\n                    || candidate.route().to_string() == query\n            })\n            .cloned()\n            .collect::<Vec<_>>(),\n        None if candidates.len() == 1 => candidates.to_owned(),\n        None => Vec::new(),\n    };\n    if matches.len() != 1 {\n        let message = match (query, matches.len()) {\n            (Some(_), 0) => \"no candidate exactly matched --device\",\n            (Some(_), _) => \"--device matched more than one candidate\",","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/target_selection.rs#L1-L33","documentation":"`select_target` in the fixture tooling resolves the physical device a fixture operation should target from a candidate list. When the candidate list is empty there is nothing addressable to select, so it bails immediately before even consulting the query. It throws because fixture recording/verification is defined only against real, enumerable hardware candidates.","triggerScenarios":"Calling `select_target` with an empty `candidates` slice — e.g. running a fixture subcommand with no compatible Logitech device attached, no receiver plugged in, or enumeration returning nothing.","commonSituations":"Running fixture commands on a machine without the device plugged in; Bluetooth-direct device not paired; on macOS, missing Input Monitoring/permissions hiding devices; agent snapshot unavailable and direct enumeration finds nothing.","solutions":["Plug in the Logitech device (or its Bolt/Unifying receiver) and rerun","Verify enumeration works: `openlogi list` shows the device","On macOS, grant Input Monitoring/Accessibility so device enumeration is not blocked","If using agent-backed snapshots, ensure the agent is running with the device visible"],"exampleFix":"// before\n$ openlogi fixture record --name case1   # no device attached\nerror: no addressable physical device candidate was found\n// after\n$ openlogi list        # confirm device present\n$ openlogi fixture record --name case1","handlingStrategy":"fallback","validationCode":"// shell pre-check: is there anything enumerable?\nopenlogi list || { echo \"no devices visible; connect hardware or check permissions\"; exit 2; }","typeGuard":null,"tryCatchPattern":"match select_target(&candidates, query) {\n    Ok(t) => proceed(t),\n    Err(e) if e.to_string().contains(\"no addressable physical device candidate\") => {\n        eprintln!(\"Connect the device (or receiver), then retry.\");\n        Err(e)\n    }\n    other => other,\n}","preventionTips":["Run `openlogi list` before any fixture command to confirm enumeration","Plug hardware in / pair Bluetooth before scripted fixture runs","On macOS ensure Input Monitoring is granted so devices are visible","Note in CI that fixture recording jobs need real hardware or the agent-mock"],"tags":["fixture","device-enumeration","cli"],"backgroundTag":"empty-result-set","analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}