{"record":{"id":"316beebc4896dcf9","repo":"FuelLabs/sway","slug":"could-not-get-plugin-info","errorCode":null,"errorMessage":"Could not get plugin info: {}","messagePattern":"Could not get plugin info: (.+?)","errorType":"console","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"forc/src/cli/commands/plugins.rs","lineNumber":146,"sourceCode":"\n    let description = parse_description_for_plugin(&path);\n\n    if describe {\n        Ok(format!(\"  {display} \\t\\t{description}\"))\n    } else {\n        Ok(display)\n    }\n}\n\n/// # Panics\n///\n/// This function assumes that file names will never be empty since it is only used with\n/// paths yielded from plugin::find_all(), as well as that the file names are in valid\n/// unicode format since file names should be prefixed with `forc-`. Should one of these 2\n/// assumptions fail, this function panics.\nfn get_plugin_info(path: PathBuf, print_full_path: bool, describe: bool) -> ForcResult<String> {\n    format_print_description(path, print_full_path, describe)\n        .map_err(|e| anyhow!(\"Could not get plugin info: {}\", e.as_ref()).into())\n}\n","sourceCodeStart":128,"sourceCodeEnd":148,"githubUrl":"https://github.com/FuelLabs/sway/blob/47e5e902faa42baf652dd6a0c88cd23390c1a614/forc/src/cli/commands/plugins.rs#L128-L148","documentation":"During `forc plugins`, each executable on PATH matching forc-* is described via get_plugin_info, which wraps format_print_description's ForcResult and prefixes \"Could not get plugin info: \". In the current implementation format_print_description always returns Ok, so this wrapper is effectively defensive; the risky part (spawning `<plugin> -h` via .expect) panics rather than producing this error. Historically it fires when formatting a discovered plugin's name/path/description fails.","triggerScenarios":"Running `forc plugins` (optionally --paths/--describe) when an executable named forc-* on PATH cannot be formatted — e.g. exotic filenames that break the get_file_name/display assumptions documented in the # Panics note.","commonSituations":"A broken or half-installed forc- prefixed binary on PATH, or leftover executables with non-unicode names; also note a plugin that crashes on `-h` hits the .expect panic in parse_description_for_plugin instead.","solutions":["Inspect PATH for stray/corrupt forc-* executables and remove or reinstall them (`which -a 'forc-*'` style scan)","Reinstall the offending plugin (cargo install --force or fuelup) so its binary is valid","If a specific plugin crashes on -h, report it — that path currently panics rather than erroring cleanly"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before invoking forc plugins, sanity-scan PATH for executables starting with 'forc-'\n// and make sure they at least run.\nfor dir in std::env::split_paths(&std::env::var_os(\"PATH\").unwrap_or_default()) {\n    if let Ok(entries) = std::fs::read_dir(dir) {\n        for e in entries.flatten() {\n            let name = e.file_name();\n            if name.to_string_lossy().starts_with(\"forc-\") && !e.path().is_file() { /* skip */ }\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"let output = std::process::Command::new(\"forc\").arg(\"plugins\").output()?;\nif !output.status.success() {\n    let stderr = String::from_utf8_lossy(&output.stderr);\n    if stderr.contains(\"Could not get plugin info\") {\n        eprintln!(\"a forc-* executable on PATH is broken; inspect PATH and reinstall plugins\");\n    }\n    return Err(anyhow::anyhow!(\"forc plugins failed: {stderr}\"));\n}","preventionTips":["Install plugins only from trusted sources (fuelup default toolchains, cargo install --locked)","Periodically prune stale forc-* binaries from custom PATH entries"],"tags":["forc","plugins","path","cli"],"backgroundTag":null,"analyzedSha":"47e5e902faa42baf652dd6a0c88cd23390c1a614","analyzedAt":"2026-08-16T07:57:45.555Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}