{"record":{"id":"b19486848ef7200c","repo":"Hmbown/CodeWhale","slug":"deepseek-harness-credentials-line-has-an-empty","errorCode":null,"errorMessage":"DeepSeek Harness credentials line {} has an empty value","messagePattern":"DeepSeek Harness credentials line (.+?) has an empty value","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/dsh_credentials.rs","lineNumber":63,"sourceCode":"        };\n        let key = key.trim();\n        if !is_posix_identifier(key) {\n            bail!(\n                \"DeepSeek Harness credentials line {} has a non-identifier key\",\n                index + 1\n            );\n        }\n        if !seen.insert(key.to_string()) {\n            bail!(\"DeepSeek Harness credentials declare `{key}` more than once\");\n        }\n        let value = unquote_yaml_string(value.trim()).map_err(|reason| {\n            anyhow::anyhow!(\n                \"DeepSeek Harness credentials line {} is invalid: {reason}\",\n                index + 1\n            )\n        })?;\n        if value.is_empty() {\n            bail!(\n                \"DeepSeek Harness credentials line {} has an empty value\",\n                index + 1\n            );\n        }\n        if key == DEEPSEEK_API_KEY_REF {\n            found = Some(value);\n        }\n    }\n    Ok(found)\n}\n\nfn is_posix_identifier(value: &str) -> bool {\n    let mut chars = value.chars();\n    matches!(chars.next(), Some('A'..='Z' | 'a'..='z' | '_'))\n        && chars.all(|ch| matches!(ch, 'A'..='Z' | 'a'..='z' | '0'..='9' | '_'))\n}\n\nfn unquote_yaml_string(value: &str) -> Result<String, &'static str> {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/dsh_credentials.rs#L45-L81","documentation":"Thrown by parse_dsh_deepseek_api_key when a line's value, after trimming and YAML-style unquoting (unquote_yaml_string), is empty. Even an explicitly quoted empty string (\"\") fails: every declared key must map to a non-empty value, and the error names the 1-based line number.","triggerScenarios":"Lines like \"DEEPSEEK_API_KEY:\" with nothing after the colon, or \"DEEPSEEK_API_KEY: \\\"\\\"\" / \"DEEPSEEK_API_KEY: ''\".","commonSituations":"Templates with placeholder keys never filled in; a rotation script blanking a revoked key instead of removing the line.","solutions":["Fill in a real value for the key on the reported line","Remove the empty-valued line entirely if the key is not needed","After rotating a key, replace the old value rather than clearing it"],"exampleFix":"# before\nDEEPSEEK_API_KEY:\n\n# after\nDEEPSEEK_API_KEY: sk-live-abc123","handlingStrategy":"validation","validationCode":"for (index, raw) in text.lines().enumerate() {\n    let line = raw.trim();\n    if line.is_empty() || line.starts_with('#') { continue; }\n    let Some((_, value)) = line.split_once(':') else { continue; };\n    if value.trim().is_empty() || matches!(value.trim(), \"\\\"\\\"\" | \"''\") {\n        return Err(anyhow::anyhow!(\"line {}: value is empty; fill it or remove the line\", index + 1));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delete unused keys instead of blanking their values","Fill placeholders before importing template files","After key rotation, replace values in place rather than emptying them"],"tags":["rust","tui","credentials","parse-error","empty-value","deepseek"],"backgroundTag":"credentials-file-parse-error","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}