{"record":{"id":"ed563ff3cc4a3999","repo":"astrid-runtime/astrid","slug":"keypair-not-found","errorCode":null,"errorMessage":"keypair {:?} not found","messagePattern":"keypair (.+?) not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/keypair.rs","lineNumber":303,"sourceCode":"    println!(\n        \"{:<24} {:<71} {:<10}  BOUND PRINCIPAL\",\n        \"NAME\", \"FINGERPRINT\", \"CREATED\",\n    );\n    for entry in entries {\n        let bound = entry.meta.bound_principal.as_deref().unwrap_or(\"-\");\n        println!(\n            \"{:<24} {:<71} {:<10}  {}\",\n            entry.name, entry.meta.fingerprint, entry.meta.created_at_epoch, bound,\n        );\n    }\n    Ok(ExitCode::SUCCESS)\n}\n\nfn run_show(args: &ShowArgs) -> Result<ExitCode> {\n    validate_name(&args.name)?;\n    let paths = KeyPaths::new(&args.name)?;\n    if !paths.meta.exists() {\n        bail!(\"keypair {:?} not found\", args.name);\n    }\n    let meta = read_meta(&paths)?;\n    let pub_hex = read_public(&paths.public_hex).unwrap_or_else(|_| \"<missing>\".to_string());\n    println!(\"name:            {}\", args.name);\n    println!(\"fingerprint:     {}\", meta.fingerprint);\n    println!(\"created (epoch): {}\", meta.created_at_epoch);\n    println!(\"backend:         {}\", meta.backend);\n    if let Some(p) = &meta.bound_principal {\n        println!(\"bound principal: {p}\");\n    }\n    if let Some(n) = &meta.note {\n        println!(\"note:            {n}\");\n    }\n    println!(\"public key (hex): {pub_hex}\");\n    println!(\"private path:    {}\", paths.private.display());\n    Ok(ExitCode::SUCCESS)\n}\n","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/keypair.rs#L285-L321","documentation":"`run_show` requires the keypair's metadata file to exist. If `<name>.meta` is missing the keypair is considered nonexistent and the command bails. Note this checks only the meta file, so a partially-deleted keypair still reports 'not found'.","triggerScenarios":"`astrid keypair show <name>` where the meta file for <name> does not exist — name typo, keypair never generated, or deleted/moved key directory.","commonSituations":"Typo in keypair name; running on a different machine or under a different user/home where keys live elsewhere; ASTRID key directory env pointing to the wrong path; cleanup scripts removed the keys.","solutions":["List existing keypairs (e.g. `astrid keypair list`) to see the correct name.","Create the keypair with `astrid keypair generate <name>` if it never existed.","Check the key directory path (env/home) — you may be pointing at the wrong location.","Fix any typos in the name passed to --name."],"exampleFix":"// before\nastrid keypair show prod-key\n// after\nastrid keypair list          # find correct name\nastrid keypair show prod_key","handlingStrategy":"validation","validationCode":"astrid keypair list | grep -qx \"$NAME\" || { echo \"keypair $NAME missing\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify keypair existence with list before show","Pin the key directory path via env in scripts","Avoid typos by sourcing names from a config, not free text"],"tags":["cli","keypair","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}