{"record":{"id":"47f83062b5108eda","repo":"Hmbown/CodeWhale","slug":"doctor-error-s","errorCode":null,"errorMessage":"doctor: {} error(s): {}","messagePattern":"doctor: (.+?) error\\(s\\): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":4727,"sourceCode":"            .is_some_and(|value| value.trim().is_empty())\n        {\n            errors.push(format!(\"`{name}` is set but empty\"));\n        }\n    }\n    for (name, endpoint) in endpoints {\n        if let Some(url) = endpoint.as_deref()\n            && !url.starts_with(\"http://\")\n            && !url.starts_with(\"https://\")\n        {\n            errors.push(format!(\"`{name}` is not an http(s) URL: {url}\"));\n        }\n    }\n\n    if !errors.is_empty() {\n        for error in &errors {\n            println!(\"error: {error}\");\n        }\n        bail!(\"doctor: {} error(s): {}\", errors.len(), errors.join(\"; \"));\n    }\n    println!(\"doctor: credentials and endpoints clean\");\n    Ok(())\n}\n\nfn telemetry_preference_status(preference: Option<bool>) -> &'static str {\n    let (enabled, source) = codewhale_config::resolved_telemetry_consent(preference);\n    if !enabled {\n        return match source {\n            codewhale_config::TelemetrySource::Env => \"Off (environment or run kill switch)\",\n            _ => \"Off (saved preference)\",\n        };\n    }\n    match telemetry::load_setup_state_for_decision() {\n        Some(state) if state.telemetry_opted_out() => \"Off (saved opt-out)\",\n        None => \"Off (privacy state unreadable)\",\n        Some(_) => match source {\n            codewhale_config::TelemetrySource::Default => \"On (default)\",","sourceCodeStart":4709,"sourceCodeEnd":4745,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L4709-L4745","documentation":"`codewhale config doctor` validates credentials and endpoint configuration. After printing each individual problem, if any errors were collected it bails with a summary of the count and semicolon-joined list, so the command exits nonzero while still surfacing each finding above the summary line.","triggerScenarios":"Running `codewhale config doctor` when its checks produced one or more entries in the `errors` vec — e.g. missing or malformed credentials, unreachable or malformed endpoint entries.","commonSituations":"API key not set or empty; endpoint URL malformed; stale provider credentials after rotation; partially migrated config from an older version.","solutions":["Read the `error: ...` lines printed immediately before the summary — they name each specific problem.","Fix each reported credential/endpoint issue (e.g. `codewhale providers` set-key flows, correcting the endpoint URL).","Re-run `codewhale config doctor` until it prints 'doctor: credentials and endpoints clean'."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// run doctor and inspect before relying on credentials\nif !run_config_doctor(&store).is_ok() {\n    eprintln!(\"fix the printed 'error:' lines before making requests\");\n}","typeGuard":null,"tryCatchPattern":"match run_config_doctor(&store) {\n    Err(e) if e.to_string().starts_with(\"doctor: \") => {\n        eprintln!(\"{e}; each problem was printed above as 'error: ...'\");\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Run `codewhale config doctor` after any credential rotation or endpoint change.","Keep API keys set for every configured provider before first use.","Treat the individual 'error:' lines as the actionable list; fix them all, then re-run until clean."],"tags":["cli","config","diagnostics"],"backgroundTag":"missing-credentials","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}