{"record":{"id":"9203f1e85351574d","repo":"astrid-runtime/astrid","slug":"invalid-uuid-format-e","errorCode":null,"errorMessage":"Invalid UUID format: {e}","messagePattern":"Invalid UUID format: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/bootstrap.rs","lineNumber":176,"sourceCode":"    workspace.or_else(|| std::env::current_dir().ok())\n}\n\n/// Resolve the session, check for an existing socket, and boot the\n/// kernel locally if necessary. Drives the interactive-session path.\n///\n/// # Errors\n/// Returns an error if the kernel fails to boot or the socket fails to connect.\npub(crate) async fn run_or_connect(\n    session: Option<String>,\n    workspace: Option<std::path::PathBuf>,\n    format: OutputFormat,\n) -> Result<()> {\n    use astrid_core::SessionId;\n    use uuid::Uuid;\n\n    let session_id = if let Some(sid) = session {\n        SessionId::from_uuid(\n            Uuid::parse_str(&sid).map_err(|e| anyhow::anyhow!(\"Invalid UUID format: {e}\"))?,\n        )\n    } else {\n        SessionId::from_uuid(Uuid::new_v4())\n    };\n    let workspace_root = selected_workspace_root(workspace);\n\n    let socket_path = socket_client::proxy_socket_path();\n    let ready_path = socket_client::readiness_path();\n\n    let outcome = astrid_core::local_transport::connect_outcome(&socket_path)\n        .await\n        .context(\"Failed to check socket\")?;\n    let action = commands::daemon::decide_ensure_action(\n        &outcome,\n        commands::daemon::recorded_daemon_pid_is_alive(),\n    );\n    let needs_boot = match action {\n        commands::daemon::EnsureAction::UseExisting => {","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/bootstrap.rs#L158-L194","documentation":"This error is raised in run_or_connect when the user-supplied --session value cannot be parsed as a UUID. The CLI parses the string with uuid::Uuid::parse_str before wrapping it in a SessionId; any string that is not a canonical (or hyphenated) 128-bit UUID fails the parse and the underlying uuid crate error is surfaced via anyhow.","triggerScenarios":"Passing --session with a non-UUID value such as a session name ('main'), a truncated ID, a UUID with invalid hex characters, or extra whitespace.","commonSituations":"Users passing a human-readable session label instead of an ID, copy-pasting a UUID that got truncated or mangled by the shell, or reusing a session ID from a different tool that uses non-UUID identifiers.","solutions":["Run the CLI without --session so a fresh UUID is generated","Validate the string with uuid::Uuid::parse_str before passing it","Check for shell-mangled characters (truncation, quotes, whitespace) in the value"],"exampleFix":"// before\nastrid-cli --session main\n// after\nastrid-cli --session 550e8400-e29b-41d4-a716-446655440000","handlingStrategy":"validation","validationCode":"fn is_valid_uuid(s: &str) -> bool { uuid::Uuid::parse_str(s).is_ok() }\nif !is_valid_uuid(&args.session) { eprintln!(\"--session must be a UUID\"); std::process::exit(2); }","typeGuard":"fn as_uuid(s: &str) -> Option<uuid::Uuid> { uuid::Uuid::parse_str(s).ok() }","tryCatchPattern":"match Uuid::parse_str(&sid) { Ok(u) => SessionId::from_uuid(u), Err(e) => { eprintln!(\"--session is not a UUID: {e}\"); std::process::exit(2); } }","preventionTips":["Omit --session to let the CLI generate a fresh UUID","Store session IDs in a config file rather than retyping them","Validate UUIDs with the uuid crate before passing them on the command line"],"tags":["cli","uuid","validation"],"backgroundTag":"invalid-identifier-format","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}