{"record":{"id":"227f9f165a2e453c","repo":"nikivdev/code","slug":"daemon-not-found-in-config","errorCode":null,"errorMessage":"daemon '{}' not found in config","messagePattern":"daemon '(.+?)' not found in config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/supervisor.rs","lineNumber":1116,"sourceCode":"}\n\nfn active_path_matches(active: &Option<PathBuf>, candidate: &Path) -> bool {\n    match active {\n        Some(active_path) => active_path == &normalize_path(candidate),\n        None => false,\n    }\n}\n\nfn normalize_path(path: &Path) -> PathBuf {\n    path.canonicalize().unwrap_or_else(|_| path.to_path_buf())\n}\n\nfn resolve_daemon_config(name: &str, config_path: Option<&Path>) -> Result<config::DaemonConfig> {\n    let cfg = daemon::load_merged_config_with_path(config_path)?;\n    cfg.daemons\n        .into_iter()\n        .find(|daemon| daemon.name == name)\n        .ok_or_else(|| anyhow::anyhow!(\"daemon '{}' not found in config\", name))\n}\n\nfn register_managed_daemon(\n    state: &SharedState,\n    daemon_cfg: &config::DaemonConfig,\n    config_path: Option<&Path>,\n    disabled: bool,\n) -> Result<()> {\n    let mut state = state.lock().expect(\"supervisor state lock\");\n    let key = daemon_key(&daemon_cfg.name, config_path);\n    let entry = ManagedDaemon {\n        name: daemon_cfg.name.clone(),\n        config_path: config_path.map(|path| path.to_path_buf()),\n        restart: daemon::restart_policy_for(daemon_cfg),\n        retry_remaining: daemon_cfg.retry,\n        autostop: daemon_cfg.autostop,\n        disabled,\n        health_failures: 0,","sourceCodeStart":1098,"sourceCodeEnd":1134,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/supervisor.rs#L1098-L1134","documentation":"resolve_daemon_config loads the merged daemon configuration and searches for a daemon whose name matches the requested one. If no daemon with that name exists in the (possibly path-overridden) config file, it throws \"daemon '{}' not found in config\".","triggerScenarios":"Calling resolve_daemon_config via handle_request, monitor_daemons, or disable_managed_daemon with a daemon name that is misspelled, was removed from the config, or exists only in a different config file than the one resolved via config_path.","commonSituations":"Typo in `f disable <name>` or supervisor request; config file edited/renamed daemon while a stale registration references the old name; pointing at the wrong config path via --config so the daemon defined in the default file is invisible.","solutions":["Run `f daemons` (or inspect the config file) to list valid daemon names and correct the spelling","Confirm you are pointing at the right config file (pass --config explicitly if needed)","Re-add the missing daemon block to the config, then retry the operation","If triggered by a stale managed-daemon record, clean up the supervisor state and re-register"],"exampleFix":"// before (CLI)\nf disable mydaemon\n// after (verify name first)\nf daemons            # list names\ndisable_worker       # use the exact name shown in config\n","handlingStrategy":"validation","validationCode":"let cfg = f_supervisor::daemon::load_merged_config_with_path(config_path)?;\nif !cfg.daemons.iter().any(|d| d.name == name) {\n    eprintln!(\"'{}' is not a configured daemon. Available: {:?}\", name,\n        cfg.daemons.iter().map(|d| &d.name).collect::<Vec<_>>());\n    return;\n}","typeGuard":null,"tryCatchPattern":"match disable_managed_daemon(state, name, config_path) {\n    Ok(_) => println!(\"disabled\"),\n    Err(e) if e.to_string().contains(\"not found in config\") => {\n        eprintln!(\"unknown daemon '{}'; list names with `f daemons`\", name);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always list configured daemon names before referencing one in scripts","Pass --config explicitly when a non-default config path is in play","Keep daemon names unique and avoid ad-hoc renames without updating callers"],"tags":["config","supervisor","daemon","not-found"],"backgroundTag":"config-entry-not-found","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}