{"record":{"id":"1dda0a36b21d202b","repo":"jlcodes99/cockpit-tools","slug":"error-1dda0a","errorCode":null,"errorMessage":"加载账号失败: {}","messagePattern":"加载账号失败: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cockpit-core/src/modules/account.rs","lineNumber":316,"sourceCode":"        .lock()\n        .map_err(|e| format!(\"获取账号列表锁失败: {}\", e))?;\n\n    if let Some(accounts) = read_list_accounts_cache() {\n        return Ok(accounts);\n    }\n\n    modules::logger::log_info(\"开始列出账号...\");\n    let index = load_account_index()?;\n    let mut accounts = Vec::new();\n\n    for summary in &index.accounts {\n        match load_account(&summary.id) {\n            Ok(mut account) => {\n                let _ = modules::quota_cache::apply_cached_quota(&mut account, \"authorized\");\n                accounts.push(account);\n            }\n            Err(e) => {\n                modules::logger::log_error(&format!(\"加载账号失败: {}\", e));\n            }\n        }\n    }\n\n    write_list_accounts_cache(&accounts);\n    Ok(accounts)\n}\n\nfn non_empty(value: Option<&str>) -> Option<&str> {\n    value.map(str::trim).filter(|v| !v.is_empty())\n}\n\nfn is_strict_account_identity_match(existing: &Account, email: &str, token: &TokenData) -> bool {\n    if let Some(session_id) = non_empty(token.session_id.as_deref()) {\n        if non_empty(existing.token.session_id.as_deref()) == Some(session_id) {\n            return true;\n        }\n    }","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/crates/cockpit-core/src/modules/account.rs#L298-L334","documentation":"Error mapping in list_accounts (cockpit-core account module): load_account failed for one index entry while listing all accounts; the error is formatted as '加载账号失败: {}' (with the per-account error interpolated), logged, and that account is skipped so the rest of the list still returns. Typical causes are a missing or corrupt per-account file referenced by the account index.","triggerScenarios":"Thrown at crates/cockpit-core/src/modules/account.rs:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the interpolated cause (IO error, JSON parse failure) for the affected account id","Remove or repair the stale account file/index entry so list_accounts stops skipping it","Restore the account from backup or re-authenticate to recreate it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1ed8b77992d62ca81fabf744deb0839ad361d5bf","analyzedAt":"2026-09-05T09:51:41.178Z","contentChangedAt":"2026-09-05T09:51:41.178Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}